ArticleID in DashboardTicketGeneric

English! place to talk about development, programming and coding
Post Reply
fulltonj
Znuny newbie
Posts: 2
Joined: 20 Oct 2010, 10:21
Znuny Version: 2.4.8

ArticleID in DashboardTicketGeneric

Post by fulltonj »

I am making a new dashboard item based upon DashboardTicketGeneric, that will display all tickets for a given agent that have resulted in one or more email responses being sent to a customer. So far so good. I can display all the tickets, with a ticket being listed multiple times if there are multiple responses. My problem: I will like to have the link itself zoom to the proper article, not just the basic ticket itself. I prepared a modified TicketSearch that includes the articleID from the ticket history table:


SELECT DISTINCT st.id, st.tn, th.article_id .......; (correct sql left out - it works)

And all of this works.

I am having a problem making the "connection" from my populated SQL results generated in my new TicketSearch subroutine to my new module to display the results, based upon DashboardTicketGeneric.pm.

The code snippet from my new module (with BasicHistorySearch being my new search routine in which the sql above is called and results returned)

my @TicketIDsArray = $Self->{TicketObject}->BasicHistorySearch(
Result => 'ARRAY',
%TicketSearch,
%{ $TicketSearchSummary{ $Self->{Filter} } },
Limit => $Self->{PageShown} + $Self->{StartHit} - 1,
);
$TicketIDs = \@TicketIDsArray;

The searching is correct, but I cannot seem to pass the ArticleID in such a way that it can be accessed in the associated DTL file.

If you look in AgentDashboardTicketGeneric.dtl you will see the ArticleID reference, below,

<a href="$Env{"Baselink"}Action=AgentTicketZoom&TicketID=$Data{"TicketID"}&ArticleID=$Data{"ArticleID"}&QueueID=$Data{"QueueID"}" onmouseover="window.status='$JSText{"Zoom"}'; return true;" onmouseout="window.status='';" title="$QData{"Title"}">$Data{"TicketNumber"}</a>

but it is never populated. I now have the Article ID available in the perl module that uses this layout, but cannot seem to access it.

Does that make any sense :-)

If so, can anyone give me a bit of advice?

Thanks -

Jim
OTRS 2.4.8 under Linux/mysql with custom Single Sign On through Oracle OAM
fulltonj
Znuny newbie
Posts: 2
Joined: 20 Oct 2010, 10:21
Znuny Version: 2.4.8

Re: ArticleID in DashboardTicketGeneric

Post by fulltonj »

I answered my own question. My new BasicHistorySearch routine was only returning the ticketID. I changed the routine to return a combined ticketID;ArticleID in the ticketID array.

Then, in DashboardTicketGeneric.pm, I extracted the ArticleID and set it in the ticket object like this:


$Ticket{ArticleID}=$ArticleID;

Now, the article ID is available in the Zoom link and all works perfectly.
OTRS 2.4.8 under Linux/mysql with custom Single Sign On through Oracle OAM
Post Reply