How to add an Owner filter to dashboard

English! place to talk about development, programming and coding
Post Reply
janneergaard
Znuny newbie
Posts: 2
Joined: 03 Dec 2011, 16:40
Znuny Version: 3.0
Real Name: Jan Neergaard
Company: Eurofins A/S

How to add an Owner filter to dashboard

Post by janneergaard »

HI

I have done some change to the dashboard but would like to add an Owner filter (like eg. Responsible, Watch and Locked). I tried to make changes to AgentDashboardTicketGeneric.pm by coping the section Responsible and remaining variables to Owner. However this did not produce any results. I suspect that I have to change the filter but where?

Thanks

Jan
scareface
Znuny newbie
Posts: 19
Joined: 22 Nov 2011, 09:05
Znuny Version: 3.1.7

[Solved] Re: How to add an Owner filter to dashboard

Post by scareface »

I had exact the same Problem and solved it by my self.
Tested with 3.0.11 and 3.1.beta3
Here my Code

Add this line to Kernel::Config

Code: Select all

$Self->{'Ticket::Owner'} =  '1';
Add this Block to Kernel::Output::HTML::DashboardTicketGeneric

Code: Select all

# Look for these Code
        Watcher => {
            WatchUserIDs => [ $Self->{UserID}, ],
            Locks        => undef,
        },
        # BEGIN NEW
        Owner => {
            OwnerIDs => [ $Self->{UserID}, ],
            Locks    => undef,
        },
        # END NEW
and add this Block to Kernel::Output::HTML::DashboardTicketGeneric

Code: Select all

# Look for these Code
# show also responsible if feature is enabled
    if ( $Self->{ConfigObject}->Get('Ticket::Responsible') ) {
        $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericFilterResponsible',
            Data => {
                %{ $Self->{Config} },
                Name => $Self->{Name},
                %{$Summary},
            },
        );
    }
    # BEGIN NEW
    if ( $Self->{ConfigObject}->Get('Ticket::Owner') ) {  #Custom Setting in Config.pm
        $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericFilterOwner',
            Data => {
                %{ $Self->{Config} },
                Name => $Self->{Name},
                %{$Summary},
            },
        );
    }
    # END NEW
Add this Block to AgentDashboardTicketGeneric.dtl

Code: Select all

<!-- dtl:block:ContentLargeTicketGenericFilterResponsible -->
...
<!-- dtl:block:ContentLargeTicketGenericFilterResponsible -->
# BEGIN NEW
<!-- dtl:block:ContentLargeTicketGenericFilterOwner -->
    <li class="$QData{"Owner::Selected"}"><a href="#" id="Dashboard$QData{"Name"}Owner">$Text{"My own Tickets"} ($QData{"Owner"})</a></li>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    $('#Dashboard$QData{"Name"}Owner').unbind('click').bind('click', function(){
        $('#Dashboard$QData{"Name"}-box').addClass('Loading');
        Core.AJAX.ContentUpdate($('#Dashboard$QData{"Name"}'), '$Env{"Baselink"}Action=$Env{"Action"};Subaction=Element;Name=$QData{"Name"};Filter=Owner', function () {
            Core.UI.Table.InitCSSPseudoClasses($('#Dashboard$QData{"Name"}'));
            $('#Dashboard$QData{"Name"}-box').removeClass('Loading');
        });
        return false;
    });
//]]></script>
<!-- dtl:js_on_document_complete -->
<!-- dtl:block:ContentLargeTicketGenericFilterOwner -->
# END NEW
<!-- dtl:block:ContentLargeTicketGenericFilterMyQueues -->
...
<!-- dtl:block:ContentLargeTicketGenericFilterMyQueues -->
OTRS: 3.1.7 (Test) 3.1.7(Prod)
OS: CentOS
Web/DB: Apache2/MySQL 5 ? MSSQL
staybb
Znuny newbie
Posts: 51
Joined: 01 Jul 2011, 09:39
Znuny Version: 3.0.4

Re: How to add an Owner filter to dashboard

Post by staybb »

I pick the topic again on.

Is it possible to add one column with the owner there (see on the picture)?


#Edit:
i found it:

/otrs/Kernel/Output/HTML/Standart/AgentDasboardTicketGeneric.dtl

add under: <!-- dtl:block:ContentLargeTicketGenericRow --> und nach der Zeile
<div title="$QData{"Title"}">$QData{"Title","70"}</div>

<td class="small" <div title="$Quote{"$Data{"CustomerID"}"}">$Quote{"$Data{"CustomerID"}"}
<td class="small" <div title="$Quote{"$Data{"Owner"}"}">$Quote{"$Data{"Owner"}"}
You do not have the required permissions to view the files attached to this post.
qt_zetroc
Znuny newbie
Posts: 37
Joined: 02 Feb 2011, 10:22
Znuny Version: 3.0.16
Contact:

Re: How to add an Owner filter to dashboard

Post by qt_zetroc »

hi can share your code of AgentDasboardTicketGeneric.dtl

Thanks.
janneergaard
Znuny newbie
Posts: 2
Joined: 03 Dec 2011, 16:40
Znuny Version: 3.0
Real Name: Jan Neergaard
Company: Eurofins A/S

Re: How to add an Owner filter to dashboard

Post by janneergaard »

Thanks scareface. Thumbs up. Works for me. :D
michaelsteib
Znuny newbie
Posts: 25
Joined: 23 Oct 2013, 14:12
Znuny Version: 3.2.11
Real Name: Michael Steib

Re: How to add an Owner filter to dashboard

Post by michaelsteib »

Hi Scareface

thanks for your posts, looks great but could you maybe explain where exactly and in which files the code has to be added?

Or do I have to add all the codes to AgentDashboardTicketGeneric.dtl? But where in there?

Thanks and best regards
Michael
paul
Znuny newbie
Posts: 11
Joined: 15 May 2018, 08:50
Znuny Version: 6.0.7

Re: How to add an Owner filter to dashboard

Post by paul »

michaelsteib +1
Post Reply