%# BEGIN LICENSE BLOCK %# %# Copyright (c) 1996-2003 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 <& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> <& '/RTIR/Search/Elements/RefineTabs', path => $path, Ticket => $Ticket, id => $id, current_subtab => "RTIR/Merge.html?id=".$Ticket->Id. "$QueryString", Queue => $Queue, Title => $title, Format => $Format, Query => $Query, Rows => $Rows, OrderBy => $OrderBy, Order => $Order, QueryString => $QueryString, &> <& /RTIR/Elements/ListActions, actions => \@results &> % if (!$Ticket->CurrentUserHasRight('ModifyTicket')) { <%loc("You are not allowed to merge this [_1].", $Type)%> % $m->abort(); % }
<& /RTIR/Search/Elements/ShowResults, Queue => $Queue, Query => $Query, QueryString => $QueryString, BaseURL => $RT::WebPath."/RTIR/Merge.html?id=$id&", Format => $Format, &>
<& /Elements/Submit, Caption=> loc('Merge into selected Ticket'), Label => loc("Merge") &>
<%INIT> $Format = $RT::RTIRSearchResultFormats->{'Merge'}; my $Ticket = LoadTicket($id); my $Queue = $Ticket->QueueObj->Name; my ($Type, @states) = $m->comp('Elements/Type', Ticket => $Ticket->Id); my $merge = $ARGS{'SelectedTicket'}; my ($MergeTicket, @results); if ($merge) { $ARGS{$id.'-MergeInto'} = $merge; $MergeTicket = LoadTicket($merge); if ($MergeTicket->QueueObj->id ne $Ticket->QueueObj->id) { push @results, loc("Merge failed: Ticket #[_1] is not the right type", $MergeTicket->Id); } else { @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); } } my $title = loc("Merge [_1] #[_2]: [_3]", $Type, $id, $Ticket->Subject); 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); $BaseQuery .= " AND id != $id" } $Query = "$BaseQuery AND ( $Query )"; my $path = "RTIR/Search/Refine.html?ResultPage=$BaseURL¤t_tab=$current_tab&Queue=" . $Ticket->QueueObj->Name . "&id=$id&$QueryString"; <%ARGS> $BaseQuery => undef $Query => undef $Format => undef $HideResults => 0 $Rows => 50 $Page => 1 $OrderBy => 'id' $Order => 'ASC' $id => undef $BaseURL => $RT::WebPath . '/RTIR/Merge.html' $current_tab => 'RTIR/Merge.html'