Adding new button to AgentTicketStatusView

Moderator: crythias

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

Adding new button to AgentTicketStatusView

Post by aph »

Following the thread viewtopic.php?f=62&t=6649. I would add a new state type to OTRS.

As the next step I would like to add a new button in addition to open tickets, closed tickets on AgentTicketStatusView screen.

Can this be done via a .dtl? I couldn't find a suitable one for that. How do I go about it?
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 new button to AgentTicketStatusView

Post by reneeb »

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
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Adding new button to AgentTicketStatusView

Post by RStraub »

Locate the module which builds the data for this view: ~otrs/Kernel/Modules/AgentTicketStatusView.pm

Then search this file for the block:

Code: Select all

    # define filter
    my %Filters = (
        Open => {
            Name   => 'Open tickets',
            Prio   => 1000,
            Search => {
                StateType  => 'Open',
                OrderBy    => $OrderBy,
                SortBy     => $SortBy,
                UserID     => $Self->{UserID},
                Permission => 'ro',
            },
        },
[...]
Below the closed tickets filter, add your new filter, like so:

Code: Select all

        CustomFilter=> {
            Name   => 'Custom Filter tickets',
            Prio   => 1002, # This defines the position on the menu
            Search => {
                StateType  => 'YourCustomStateTypeHere',
                OrderBy    => $OrderBy,
                SortBy     => $SortBy,
                UserID     => $Self->{UserID},
                Permission => 'ro',
            },
        },
Edit: Well, this is what reneeb posted...
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Adding new button to AgentTicketStatusView

Post by aph »

Thank you
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
Locked