[SOLVED] Ticket Queue Overview: total of totals

Moderator: crythias

Post Reply
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

[SOLVED] Ticket Queue Overview: total of totals

Post by HervE »

Hello forum,

I like the Ticket Queue Overview on the Dashboard, but I am missing the total of totals in the bottom right cell.

I went to AgentDashboardTicketQueueOverview.dtl and added the last <a> tag in the following code part:

Code: Select all

<!-- dtl:block:ContentLargeTicketQueueOverviewStatusTotalRow -->
        <tr class="Row">
            <td class="QueueOverviewTotals">$Text{"Totals"}</td>
<!-- dtl:block:ContentLargeTicketQueueOverviewStatusTotal -->
            <td class="QueueOverviewTotals"><a class="AsBlock" href="$Env{"Baselink"}Action=AgentTicketSearch;Subaction=Search;$QEnv{"ChallengeTokenParam"};StateIDs=$LQData{"StateID"};$QData{"QueueIDs"};$QData{"Sort"}">$Text{"$Data{"Number"}"}</a></td>
<!-- dtl:block:ContentLargeTicketQueueOverviewStatusTotal -->
            <td class="QueueOverviewTotals"><a class="AsBlock" href="$Env{"Baselink"}Action=AgentTicketSearch;Subaction=Search;$QEnv{"ChallengeTokenParam"};$QData{"QueueIDs"};$QData{"StateIDs"};$QData{"Sort"}">$Text{"$Data{"Number"}"}</a></td>
        </tr>
<!-- dtl:block:ContentLargeTicketQueueOverviewStatusTotalRow -->
But it remains empty.

Any solution?

Best regards,
HervE
Last edited by HervE on 05 Nov 2014, 09:48, edited 1 time in total.
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: Ticket Queue Overview: totals of totals

Post by HervE »

Any idea anybody?

I think there must be something wrong in the syntax of my code, for I don't really know which parameters are expected for Action=AgentTicketSearch.

Regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
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: Ticket Queue Overview: totals of totals

Post by reneeb »

*) You should keep the parameter names (e.g. you have removed "StateIDs=" from the link)
*) You have to pass the needed information when the ContentLargeTicketQueueOverviewStatusTotalRow-Block is activated (https://github.com/OTRS/otrs/blob/rel-3 ... ew.pm#L219)
*) you may have to calculate some numbers/parameters before you activate the block
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: Ticket Queue Overview: totals of totals

Post by HervE »

Thanks to your hints, I managed!
Here is what I've done, in case anybody's interested.

In OTRS\Custom\Kernel\Output\HTML\DashboardTicketQueueOverview.pm (the code I've added is tagged with "HvL"):

Code: Select all

    if ($HasContent) {
        $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketQueueOverviewStatusTotalRow',
        );

        my $TotalTotal;	# HvL
        for my $StateOrderID ( sort { $a <=> $b } keys %ConfiguredStates ) {
            $Self->{LayoutObject}->Block(
                Name => 'ContentLargeTicketQueueOverviewStatusTotal',
                Data => {
                    Number   => $StatusTotal[$StateOrderID],
                    QueueIDs => $QueueIDURL,
                    StateID  => $States{ $ConfiguredStates{$StateOrderID} },
                    Sort     => $Sort,
                },
            );
            # HvL Calculate total of totals
            $TotalTotal += $StatusTotal[$StateOrderID];
        }

        # HvL Print total of totals
        $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketQueueOverviewTotalTotal',
            Data => {
                Number   => $TotalTotal,
                QueueIDs => $QueueIDURL,
                StateIDs => $StateIDURL,
                Sort     => $Sort,
            },
        );

    }
And in OTRS\Custom\Kernel\Output\HTML\Standard\AgentDashboardTicketQueueOverview.dtl:

Code: Select all

        <tr class="Row">
            <td class="QueueOverviewTotals">$Text{"Totals"}</td>
<!-- dtl:block:ContentLargeTicketQueueOverviewStatusTotal -->
            <td class="QueueOverviewTotals"><a class="AsBlock" href="$Env{"Baselink"}Action=AgentTicketSearch;Subaction=Search;$QEnv{"ChallengeTokenParam"};StateIDs=$LQData{"StateID"};$QData{"QueueIDs"};$QData{"Sort"}">$Text{"$Data{"Number"}"}</a></td>
<!-- dtl:block:ContentLargeTicketQueueOverviewStatusTotal -->
<!-- dtl:block:ContentLargeTicketQueueOverviewTotalTotal -->
            <td class="QueueOverviewTotals"><a class="AsBlock" href="$Env{"Baselink"}Action=AgentTicketSearch;Subaction=Search;$QEnv{"ChallengeTokenParam"};$QData{"QueueIDs"};$QData{"StateIDs"};$QData{"Sort"}">$Text{"$Data{"Number"}"}</a></td>
<!-- dtl:block:ContentLargeTicketQueueOverviewTotalTotal -->
        </tr>
It works!

Best regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
Post Reply