[SOLVED] Adding custom buttons to toolbars

Moderator: crythias

Locked
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

[SOLVED] Adding custom buttons to toolbars

Post by aph »

How do I add custom buttons to the web interface? For example, when I open a ticket and click on say 'phone call outbound', a new window is opened and I can insert information. I would like to add a custom button to this toolbar. How can I do that?
Last edited by aph on 21 Jul 2014, 13:58, edited 1 time in total.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Adding custom buttons to toolbars

Post by RStraub »

Try Process Management and Activity Dialogs ;)
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding custom buttons to toolbars

Post by crythias »

or modify .dtls...
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
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Adding custom buttons to toolbars

Post by aph »

Which .dtl do I have to edit to add a button to the following toolbar?
Unbenannt_6.PNG
You do not have the required permissions to view the files attached to this post.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding custom buttons to toolbars

Post by crythias »

Please begin with "How can I create a button in [this place] that accomplishes [this goal]".
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
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Adding custom buttons to toolbars

Post by aph »

How can I create a button between 'Phone call outbound' and 'phone call inbound' on the toolbar in the screenshot below?
Unbenannt_6.PNG
By clicking on this button, a window should be opened and an agent should be able to fill in certain information, for example when the relevant change was implemented on the development system, by whom, by whom it was tested etc.
You do not have the required permissions to view the files attached to this post.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Adding custom buttons to toolbars

Post by reneeb »

The buttons are created with SysConfig options (see https://github.com/OTRS/otrs/blob/rel-3 ... .xml#L4925)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Adding custom buttons to toolbars

Post by aph »

Take this entry in Ticket -> Frontend::Agent::Ticket::MenuModule for example:
Unbenannt_18.PNG
How can I add, for example, an entry ' Ticket::Frontend::MenuModule###someNumber-TestAction' to 'Ticket -> Frontend::Agent::Ticket::MenuModule' so that I can fill in the relevant values for 'Action....Target''?
You do not have the required permissions to view the files attached to this post.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Adding custom buttons to toolbars

Post by reneeb »

Create a Kernel/Config/Files/APH.xml (or any other name that is not already used)

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
    <ConfigItem Name="Ticket::Frontend::MenuModule###321-YourButton" Required="0" Valid="1">
        <Description Translatable="1">Your Description.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::MenuModule</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::TicketMenuGeneric</Item>
                <Item Key="Name">What the user can see in TicketZoom</Item>
                <Item Key="Description" Translatable="1">Description for MouseOver</Item>
                <Item Key="Action">AgentTicketHistoryXXXXX</Item>
                <Item Key="Link">Action=AgentTicketHistoryXXXXX;TicketID=$QData{"TicketID"}</Item>
                <Item Key="Target"></Item>
                <Item Key="PopupType">TicketHistory</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding custom buttons to toolbars

Post by crythias »

aph wrote:By clicking on this button, a window should be opened and an agent should be able to fill in certain information, for example when the relevant change was implemented on the development system, by whom, by whom it was tested etc.
You mean you want to add a note only not using the note button.
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
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Adding custom buttons to toolbars

Post by aph »

The button does not appear under Ticket -> Frontend::Agent::Ticket::MenuModule. I changed the code slightly and want to reproduce the history function. Do I have to register the new file somewhere or why does it not appear in SysConfig.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
    <ConfigItem Name="Ticket::Frontend::MenuModule###12-YourButton" Required="0" Valid="1">
        <Description Translatable="1">Your Description.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::MenuModule</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::TicketMenuGeneric</Item>
                <Item Key="Name">TestView</Item>
                <Item Key="Description" Translatable="1">See Data</Item>
                <Item Key="Action">AgentTicketHistory</Item>
                <Item Key="Link">Action=AgentTicketHistory;TicketID=$QData{"TicketID"}</Item>
                <Item Key="Target"></Item>
                <Item Key="PopupType">TicketHistory</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Adding custom buttons to toolbars

Post by aph »

crythias wrote: You mean you want to add a note only not using the note button.
Not exactly a note. For example the details about who implemented the change or who tested it should be retrieved from AD and not entered as text (to avoid typos). One scenario is:

On one line we have the entries: Tested on: <Date> Tested by:<Name of the tester retrieved from AD>.
The concerned persons should be informed about the change (for example in a 'To' or 'CC' field in the 'note').

Apart from the 'note' as an example, a functionality that may be required in the future is to execute a custom action / Javascript by clicking on a button.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Adding custom buttons to toolbars

Post by aph »

After I logged in today, the button was available. Probably a cache / reset thing
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
numerouno
Znuny newbie
Posts: 26
Joined: 19 Jun 2014, 13:02
Znuny Version: OTRS 4.0.3

Re: [SOLVED] Adding custom buttons to toolbars

Post by numerouno »

I am trying to accomplish similar to OP, a custom menu item and be able to configure which items appear (Priority, Owner, Note, etc)

I've created the custom menu item in ticket zoom menu copying settings for FreeText button in Ticket.xml, but I wish to have unique control of field selection as in > Edit Config Settings in Ticket -> Frontend::Agent::Ticket::ViewFreeText

Where can I add these config settings?
Locked