%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# %# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) %# %# %# LICENSE: %# %# 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. %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA %# 02110-1301 or visit their web page on the internet at %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: %# %# (The following paragraph is not intended to limit the rights granted %# to you to modify and distribute this software under the terms of %# the GNU General Public License and is only of importance to you if %# you choose to contribute your changes and enhancements to the %# community by submitting them to Best Practical Solutions, LLC.) %# %# By intentionally submitting any modifications, corrections or %# derivatives to this work, or any other work intended for use with %# Request Tracker, to Best Practical Solutions, LLC, you confirm that %# you are the copyright holder for those contributions and you grant %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, %# royalty-free, perpetual, license to use, copy, create derivative %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# %# END BPS TAGGED 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 => ()