%# 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/Tabs, current_subtab => 'RTIR/Incident/ShowReports.html', Title => $title &>
> <& /RTIR/Elements/Listing, url => "LinkToIncident.html?id=$id", Type => 'Incident', Queue => 'Incidents', check => 'radio', %ARGS &> <& /Elements/Submit, Name => "SubmitTicket", Caption => $SubmitCaption, Label => loc("Link") &>

<& /RTIR/Elements/SearchFields, Path => 'LinkToIncident.html', Queue => $QueueObj->Name, %ARGS &> <%INIT> my $ChildObj = LoadTicket($id); my $SubmitCaption = loc("Link #[_1] with selected Incident", $ChildObj->id); my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load('Incidents') || Abort(loc("Queue could not be loaded.")); my $name; if ($ChildObj->QueueObj->Name eq "Incident Reports") { $name = "Incident Report"; } elsif ($ChildObj->QueueObj->Name eq "Investigations") { $name = "Investigation"; } elsif ($ChildObj->QueueObj->Name eq "Blocks") { $name = "Block"; } if (! $session{'tickets'}) { # Init a new search $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} ); } my ($title, $ticketcount); $session{'i'}++; if ($session{'tickets'}) { if ($ARGS{'DeleteRestriction'}) { $session{'tickets'}->DeleteRestriction($ARGS{'DeleteRestriction'}); } if ( ($ARGS{'ClearRestrictions'}) || ($ARGS{'NewSearch'}) ) { $session{'tickets'}->ClearRestrictions; $session{'tickets'}->LimitQueue(VALUE => $QueueObj->Name); my $CustomFields = $QueueObj->CustomFields(); $CustomFields->{'find_disabled_rows'} = 1; while (my $CustomField = $CustomFields->Next()) { if ($CustomField->Name eq '_RTIR_State') { $session{'tickets'}->LimitCustomField(CUSTOMFIELD => $CustomField->Id, VALUE => 'open'); } } } } ProcessSearchQuery(ARGS=>\%ARGS); $session{'tickets'}->RedoSearch(); if ( $session{'tickets'}->DescribeRestrictions()) { $ticketcount = $session{tickets}->Count(); } else { } # Iterate through the ARGS hash and remove anything with a null value. map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS); my ($bgcolor); my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorAddresses DueAsString ); Abort(loc("No search to operate on.")) unless ($session{'tickets'}); $title = loc("Link [_1] #[_2] to selected Incident", $name, $id); <%ARGS> $id => undef