[SOLVED]Can't Hide certain dashlet filters

Moderator: crythias

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

[SOLVED]Can't Hide certain dashlet filters

Post by aph »

As discussed in my other post viewtopic.php?f=62&t=29269#p118443 I'm able to hide all the dashlet filters (my locked tickets, my responsibiities, tickets in my queues and all tickets) together by commenting out the follwing in ..../otrs/Kernel/Output/Files/DashboardTicketGeneric.pm

Code: Select all

# get filter ticket counts
    $Self->{LayoutObject}->Block(
        Name => 'ContentLargeTicketGenericFilter',
        Data => {
            %Param,
            %{ $Self->{Config} },
            Name => $Self->{Name},
            %{$Summary},
        },
    );
I could also hide the filter 'Tickets in my queues' by commenting out the following

Code: Select all

 # show only myqueues if we have the filter
    if ( $TicketSearchSummary{MyQueues} ) {
        $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericFilterMyQueues',
            Data => {
                %Param,
                %{ $Self->{Config} },
                Name => $Self->{Name},
                %{$Summary},
            },
        );
    }
And the filter 'My responsibilities' by commenting out

Code: Select all

# show also responsible if feature is enabled
    if ( $Self->{ConfigObject}->Get('Ticket::Responsible') ) {
        $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericFilterResponsible',
            Data => {
                %Param,
                %{ $Self->{Config} },
                Name => $Self->{Name},
                %{$Summary},
            },
        );
    }
My question is how do I hide each of the filters 'My locked tickets' and 'All Tickets' individually, independant of the other filters?
Last edited by aph on 01 Jun 2015, 09:52, 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
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Can't Hide certain dashlet filters

Post by aph »

I saw that there is a dtl called AgentDashboardTicketGeneric.dtl in ..../otrs/Kernel/Output/HTML/Standard. If I comment out the following line in this dtl, the 'All Tickets' filter is hidden

Code: Select all

  <li class="$QData{"All::Selected"} Last"><a href="#" id="Dashboard$QData{"Name"}All" data-filter="All">$Text{"All tickets"} ($QData{"All"})</a></li>
However, I'm using a custom pm for my dashlet which is a copy of ..../otrs/Kernel/Output/Files/DashboardTicketGeneric.pm. I also created a custom dtl called CustomAgentDashboardTicketGeneric.dtl which is a copy of AgentDashboardTicketGeneric.dtl.
So my revised question is how do I tell my custom pm (CustomDashboardTicketGeneric.pm) to use the custom .dtl (CustomAgentDashboardTicketGeneric.dtl) to render my widget?
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: Can't Hide certain dashlet filters

Post by RStraub »

I will give you the example from OTRS 4.x. Look in your pm file for the Block that creates the output. It should be called $LayoutObject->Output or something similar.

There you see the attribute / parameter "TemplateFile". Just edit the name that follows to your custom file:

Code: Select all

    my $Content = $LayoutObject->Output(
        TemplateFile => 'AgentDashboardTicketGeneric',
        Data         => {
            %{ $Self->{Config} },
            Name => $Self->{Name},
            %{$Summary},
            FilterValue => $Self->{Filter},
            CustomerID  => $Self->{CustomerID},
        },
        KeepScriptTags => $Param{AJAX},
    );
So instead of AgentDashboardTicketGeneric, use CustomAgentDashboardTicketGeneric.
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: [SOLVED]Can't Hide certain dashlet filters

Post by aph »

Bingo :D
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