%# 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/LinkTabs, Queue => 'Incident Reports', Ticket => $IncidentObj, current_tab => 'RTIR/Incident/ShowChildren.html?Queue=Incident Reports&id='.$IncidentObj->id, current_subtab => 'RTIR/Incident/ReplyToReporters.html', Tab => 'Bulk Reply', Title => $title &> <& /Elements/ListActions, actions => \@results &>
> > >

Reporters

<& /RTIR/Search/Elements/ShowResults, BaseQuery => $BaseQuery, Query => "($Query) AND Queue = 'Incident Reports'", QueryString => $QueryString, BaseURL => $BaseURL, Format => $Format, &>

Investigation Correspondents

<& /RTIR/Search/Elements/ShowResults, BaseQuery => $BaseQuery, Query => "($Query) AND Queue = 'Investigations'", QueryString => $QueryString, BaseURL => $BaseURL, Format => $Format, &>
% my $i; <& /Elements/TitleBoxStart, title => loc('Reply to selected tickets') &> <& /RTIR/Elements/UpdateData, %ARGS &>
<&|/l&>Owner: <& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{Owner}||$session{'CurrentUser'}->Id||undef), &> <&|/l&>Worked: <&|/l&>minutes
<&|/l&>Update Type:
<&|/l&>Subject: (<&|/l&>uses subjects from tickets)
<& /Elements/TitleBoxEnd &> <& /Elements/Submit, Name => "SubmitTicket", Caption => $SubmitCaption, Label => $SubmitLabel &>
<%INIT> $Format = $RT::RTIRSearchResultFormats->{'BulkReply'}; my $IncidentObj = LoadTicket($id); my $title; if (!$Query) { $Query = "('CF.Incident Reports.{_RTIR_State}' = 'open' OR 'CF.Investigations.{_RTIR_State}' = 'open') AND MemberOf = $id"; } my $QueryString = "&".$m->comp('/Elements/QueryString', Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order, Page => $Page); if (!$BaseQuery) { $BaseQuery = "Queue = 'Incident Reports'"; $BaseQuery = "($BaseQuery OR Queue = 'Investigations')" if $All; } $Query = "$BaseQuery AND ( $Query )"; my ($SubmitCaption, $SubmitLabel); if ($ARGS{'DefaultStatus'} eq 'resolved') { $title = loc("Resolve Incident #[_1] (including children)", $id); $SubmitCaption = loc("Resolve Incident"); $SubmitLabel = loc("Resolve"); } elsif ($ARGS{'DefaultStatus'} eq 'rejected') { $title = loc("Abandon Incident #[_1] (including children)", $id); $SubmitCaption = loc("Abandon Incident"); $SubmitLabel = loc("Abandon"); } else { $SubmitCaption = loc("Reply to selected correspondents"); $SubmitLabel = loc("Reply"); if ($All) { $title = loc("Incident #[_1]: Reply to All", $id); } else { $title = loc("Incident #[_1]: Reply to Reporters", $id); } } my (@results, @statusresults); my ($CommentDefault, $ResponseDefault); if (($ARGS{'Action'} eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) { $CommentDefault = "SELECTED"; } else { $ResponseDefault = "SELECTED"; } my $Incident = LoadTicket($ARGS{'id'}); # Iterate through the ARGS hash and remove anything with a null value. map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS); Abort(loc("No search to operate on.")) unless ($session{'tickets'}); my $do_comment_reply=0; # Prepare for ticket updates $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; chomp ($ARGS{'UpdateContent'}) ; if (($ARGS{ProcessReply} && $ARGS{Status} eq 'resolved' || $ARGS{Status} eq 'rejected') || $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne '' && $ARGS{'UpdateContent'} ne "-- \n" . $session{'CurrentUser'}->UserObj->Signature) { $do_comment_reply=1; } my (@updateresults, @basicresults, @watchresults); if ($do_comment_reply) { @statusresults = ProcessTicketBasics(TicketObj => $Incident, ARGSRef => \%ARGS); } my $MyTickets = new RT::Tickets($session{'CurrentUser'}); $MyTickets->FromSQL("$Query"); #Iterate through each ticket we've been handed while (my $Ticket = $MyTickets->Next) { my ($oldstate, $newstate); $oldstate = $Ticket->FirstCustomFieldValue('_RTIR_State'); if ($do_comment_reply) { next unless ($ARGS{"UpdateTicket".$Ticket->Id}); ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS); @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS); } my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS); my @tempresults = (@basicresults, @watchresults, @updateresults, @dateresults); $newstate = $Ticket->FirstCustomFieldValue('_RTIR_State'); if ($newstate ne $oldstate) { push (@tempresults, loc("State changed from [_1] to [_2]", $oldstate, $newstate)); } @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; @results = (@results, @tempresults); } @results = (@statusresults, @results); <%ARGS> $id => undef $All => 0 $BaseURL => $RT::WebPath . "/RTIR/Incident/Reply.html?DefaultStatus=stalled&id=$id" $BaseQuery => undef $Query => undef $Format => undef $HideResults => 0 $Rows => 50 $Page => 1 $OrderBy => 'id' $Order => 'ASC' $Action => 'Correspond'