[SOLVED] Getting $Data from other dtl blocks

Moderator: crythias

Locked
FiL
Znuny newbie
Posts: 69
Joined: 13 Jul 2010, 18:02
Znuny Version: 2.4.7

[SOLVED] Getting $Data from other dtl blocks

Post by FiL »

Hey.

I´m rebuilding the AgentDashboard and I need $Data{"Name"}, which contains the names of the different filters (New Tickets, Open Tickets...). (File: Kernel/Output/HTML/Standard/AgentDashboardTicketGeneric.dtl)

Of course I can use it in the ContentLargeTicketGenericFilter Blocks because it´s specified in the Kernel/Output/HTML/DashboardTicketGeneric. But I need it in the ContentLargeTicketGenericRow dtl block.

Any ideas?

Best regards
FiL
Last edited by FiL on 01 Aug 2012, 15:12, edited 1 time in total.
Dev
OTRS-Version: 3.1.7
System: Ubuntu Linux

Prod
OTRS-Version 3.0.9
System: Ubuntu Linux
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Getting $Data from other dtl blocks

Post by crythias »

If you've seen that far, you probably would have been close enough to figure out what you need.
Kernel/Output/HTML/DashboardTicketGeneric.pm

Code: Select all

    # get filter ticket counts
    $Self->{LayoutObject}->Block(
        Name => 'ContentLargeTicketGenericFilter',
        Data => {
            %{ $Self->{Config} },
            Name => $Self->{Name},
            %{$Summary},
        },
    );
and then

Code: Select all

        $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericRow',
            Data => \%Ticket,
        );
Fill what you want into additional Data.
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
FiL
Znuny newbie
Posts: 69
Joined: 13 Jul 2010, 18:02
Znuny Version: 2.4.7

Re: Getting $Data from other dtl blocks

Post by FiL »

Tried that but the problem is that if I change it to

Code: Select all

 $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericRow',
            Data => { Name => $Self->{Name},
                           \%Ticket,
            },
        );
It will add an additional empty line in front of the tickets in the Dashboard
Last edited by FiL on 01 Aug 2012, 14:24, edited 1 time in total.
Dev
OTRS-Version: 3.1.7
System: Ubuntu Linux

Prod
OTRS-Version 3.0.9
System: Ubuntu Linux
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Getting $Data from other dtl blocks

Post by crythias »

You didn't close "Data" btw. I don't know that makes a difference, but...
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
FiL
Znuny newbie
Posts: 69
Joined: 13 Jul 2010, 18:02
Znuny Version: 2.4.7

Re: Getting $Data from other dtl blocks

Post by FiL »

Yeah just edited it, but no difference.

I made a workaround by using the StadeIDs of the ticket, but it would be more comfortable if I could get the FilterNames
Dev
OTRS-Version: 3.1.7
System: Ubuntu Linux

Prod
OTRS-Version 3.0.9
System: Ubuntu Linux
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Getting $Data from other dtl blocks

Post by crythias »

FiL wrote:It will add an additional empty line in front of the tickets in the Dashboard
Because of what? (What field is providing the blank line?)
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
FiL
Znuny newbie
Posts: 69
Joined: 13 Jul 2010, 18:02
Znuny Version: 2.4.7

Re: Getting $Data from other dtl blocks

Post by FiL »

Just saw that I made it different sorry.
I tried the one I quoted before but that didn´t work so I left it like this

Code: Select all

 $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericRow',
            Data => \%Ticket,
        );
and added

Code: Select all

 $Self->{LayoutObject}->Block(
            Name => 'ContentLargeTicketGenericRow',
            Data => { Name => $Self->{Name},
              },
        );
That´s the one solution with the additional empty line.
Dev
OTRS-Version: 3.1.7
System: Ubuntu Linux

Prod
OTRS-Version 3.0.9
System: Ubuntu Linux
FiL
Znuny newbie
Posts: 69
Joined: 13 Jul 2010, 18:02
Znuny Version: 2.4.7

Re: Getting $Data from other dtl blocks

Post by FiL »

crythias wrote:
FiL wrote:It will add an additional empty line in front of the tickets in the Dashboard
Because of what? (What field is providing the blank line?)
No field gave me the additional line. It´s just like if the first line comes like the "first" ticket although it´s the Name of the Filter and therefore is empty, because it has not the same attributes as a ticket.

I´ll try to catch that with Java Script I think.
Dev
OTRS-Version: 3.1.7
System: Ubuntu Linux

Prod
OTRS-Version 3.0.9
System: Ubuntu Linux
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Getting $Data from other dtl blocks

Post by crythias »

oh. so it's counting the number of entries (?) that's ... interesting, and makes sense, kinda. Which means you're trying to use a global attribute with a line item.
That does beg a question, though ...
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
FiL
Znuny newbie
Posts: 69
Joined: 13 Jul 2010, 18:02
Znuny Version: 2.4.7

Re: Getting $Data from other dtl blocks

Post by FiL »

Image

The lines with the +/- are the queues.

You see the additional + above?
That´s what I mean
But I should be able to catch the first line in the .dtl file

/e Hope it works
Dev
OTRS-Version: 3.1.7
System: Ubuntu Linux

Prod
OTRS-Version 3.0.9
System: Ubuntu Linux
FiL
Znuny newbie
Posts: 69
Joined: 13 Jul 2010, 18:02
Znuny Version: 2.4.7

Re: Getting $Data from other dtl blocks

Post by FiL »

Just solved it with Javascript.

Just "asked" the lines if there is a Queue and if there isn´t the line gets ignored

Thank you for your replies and your help.
Dev
OTRS-Version: 3.1.7
System: Ubuntu Linux

Prod
OTRS-Version 3.0.9
System: Ubuntu Linux
Locked