%# BEGIN LICENSE BLOCK %# %# Copyright (c) 1996-2002 Jesse Vincent %# %# (Except where explictly superceded by other copyright notices) %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have %# been provided with this software, but in any event can be snarfed %# from www.gnu.org %# %# This work is distributed in the hope that it will be useful, but %# WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# %# %# Unless otherwise specified, all modifications, corrections or %# extensions to this work which alter its source code become the %# property of Best Practical Solutions, LLC when submitted for %# inclusion in the work. %# %# %# END LICENSE BLOCK <& /RTIR/Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> <& Elements/LinkTabs, Queue => $Queue, Ticket => $IncidentObj, current_subtab => 'RTIR/Incident/LinkChildren.html?ClearRestrictions=1&id='.$IncidentObj->id.'&Queue='.$Queue, Tab => loc('Link [_1]', $Queue), Title => $title, &>
> <& /RTIR/Search/Elements/ShowResults, Queue => $Queue, Query => $Query, QueryString => $QueryString, BaseURL => $BaseURL, Format => $Format, &> <& /Elements/Submit, Name => "SubmitTicket", Caption => $SubmitCaption, Label => loc("Link") &>
<%INIT> my $IncidentObj = LoadTicket($id); my $SubmitCaption = loc("Link selected with Incident #[_1]", $IncidentObj->id); $Format = $RT::RTIRSearchResultFormats->{'LinkChildren'}; my $TicketObj = new RT::Ticket($session{'CurrentUser'}); $TicketObj->Load($id); my ($Type, @states) = $m->comp('/RTIR/Elements/Type', Queue => $Queue); my ($LinkType, @linkstates) = $m->comp('/RTIR/Elements/Type', Queue => $Queue); my ($title, $ticketcount); $session{'i'}++; $session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'}); $session{'tickets'}->FromSQL($Query) if ($Query); $session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'} or $Order ne $session{'CurrentSearchHash'}->{'Order'}) { $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy; $session{'CurrentSearchHash'}->{'Order'} = $Order; # Invalidate the ordering cache undef $session{'tickets'}->{'items_array'}; } if ( $session{'tickets'}->Query()) { $ticketcount = $session{tickets}->CountAll(); $title = loc("Found [quant,_1,$Type]", $ticketcount); } else { $title = loc("Link selected [_1] to Incident #[_2]", $Queue, $IncidentObj->Id); } if (!$Query) { $Query = $m->comp('/RTIR/Elements/NewQuery', Queue => $Queue); } my $QueryString = "&".$m->comp('/Elements/QueryString', Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order, Page => $Page); if (!$BaseQuery) { $BaseQuery = $m->comp('/RTIR/Elements/BaseQuery', Queue => $Queue); } $Query = "$BaseQuery AND ( $Query )"; <%ARGS> $id => undef $Queue => undef $BaseURL => $RT::WebPath . "/RTIR/Incident/LinkChildren.html" $Status => 'open', $BaseQuery => undef $Query => undef $Format => undef $HideResults => 0 $Rows => 50 $Page => 1 $OrderBy => 'id' $Order => 'ASC'