%# 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 &> <& /Elements/Tabs &> <& /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, Statuses => [@Statuses], FullList => RT->Config->Get('WebPath')."/RTIR/Incident/Children/?Queue=$Queue&id=$id", Delete => $delete, ShowHeader => 1, ShowStatusesSelector => 1, &> <& /Elements/Submit, Name => 'Unlink', Label => loc('Unlink Report') &>
<%INIT> my $Incident = LoadTicket($id); $id = $ARGS{'id'} = $Incident->Id; my @results; 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 ); } MaybeRedirectForResults( Actions => \@results, Arguments => { id => $id, Queue => $Queue }, ); 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; @Statuses = RT::IR->Statuses( Queue => $Queue ) unless @Statuses; my $children = RT::Tickets->new( $session{'CurrentUser'} ); $children->FromSQL( RT::IR->Query( Queue => $Queue, MemberOf => $Incident, Status => [@Statuses], ) ); my $all_children = RT::Tickets->new( $session{'CurrentUser'} ); $all_children->FromSQL( RT::IR->Query( Queue => $Queue, MemberOf => $Incident, ) ); <%ARGS> $id => undef $Queue => 'Incident Reports' @SelectedTickets => () @Statuses => ()