%# 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 &> <& /RTIR/Search/Elements/RefineTabs, Title => $Title, Ticket => $Incident, Queue => $Queue, current_tab => $current_tab, &> <& /Elements/ListActions, actions => \@results &> % if( $children->CountAll == $all_children->CountAll ) {

<% loc('Total [_1]: [_2]', $Queue, $children->CountAll) %>

% } else {

<% loc('Total [_1]: [_2]([_3])', $Queue, $children->CountAll, $all_children->CountAll) %>

% }
<& /RTIR/Elements/ShowChildren, Ticket => $Incident, Queue => $Queue, States => [@States], FullList => RT->Config->Get('WebPath')."/RTIR/Incident/ShowChildren.html?Queue=$Queue&id=$id", Delete => $delete, ShowHeader => 1, ShowStatesSelector => 1, &> <& /Elements/Submit, Name => 'Unlink', Label => loc('Unlink Report') &>
<%INIT> my @results; my $Incident = LoadTicket($id); $id = $ARGS{'id'} = $Incident->Id; if( $ARGS{'Unlink'} ) { # translate the checkbox args to what ProcessTicketLinks expects $ARGS{'DeleteLink-'. $_ .'-MemberOf-'} = 1 for @SelectedTickets; my $strict_acl = RT->Config->Set( StrictLinkACL => 0 ); push @results, ProcessTicketLinks( TicketObj => $Incident, ARGSRef => \%ARGS ); RT->Config->Set( StrictLinkACL => $strict_acl ); } unless ( $Incident->CurrentUserHasRight('ShowTicket') ) { Abort("No permission to view ticket"); } my $Title = loc("$Queue for Incident #[_1]: [_2]", $id, $Incident->Subject); my $delete = $Incident->CurrentUserHasRight('ModifyTicket') ? 1: 0; my $children = RT::Tickets->new( $session{'CurrentUser'} ); $children->FromSQL( $m->comp( '/RTIR/Elements/ChildrenQuery', Queue => $Queue, Ticket => $Incident, States => [@States], ) ); my @possible_states = RT::IR::States( Queue => $Queue, Inactive => 1 ); my $all_children = RT::Tickets->new( $session{'CurrentUser'} ); $all_children->FromSQL( $m->comp( '/RTIR/Elements/ChildrenQuery', Queue => $Queue, Ticket => $Incident, States => [@possible_states], ) ); my $current_tab = 'RTIR/Incident/ShowChildren.html?' . $m->comp( '/Elements/QueryString', id => $id, Queue => $Queue ); <%ARGS> $id => undef $Queue => 'Incident Reports' @SelectedTickets => () @States => ()