%# BEGIN LICENSE BLOCK %# %# Copyright (c) 1996-2003 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/'.$Type.'/Elements/Tabs', Ticket => $Ticket, current_subtab => "RTIR/Edit.html?id=".$Ticket->Id, Title => $title &>
% if ($Type eq 'Report' and $ARGS{'DefaultStatus'} eq 'rejected') { % while (my $link = $Ticket->MemberOf->Next) { % my $member = $link->TargetObj; % if ($member->QueueObj->Name eq 'Incidents') { % } % } % }
<&|/l&>Correspondents <&|/l&>Requestor: <% $Ticket->RequestorAddresses %>
  <&|/l&>Cc: <% $Ticket->CcAddresses %>
  <&|/l&>AdminCc: <% $Ticket->AdminCcAddresses %>

<& /RTIR/Elements/UpdateData, Ticket => $Ticket, Type => 'Incident', %ARGS &>
<&|/l&>State: <%$State%>
<&|/l&>Update Type:
<&|/l&>Owner: <& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{Owner}||$Ticket->OwnerObj->Id()||$session{'CurrentUser'}->Id||undef), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &> <&|/l&>Worked: <&|/l&>minutes
<&|/l&>Subject:
<& /Elements/Submit, Name => 'SubmitTicket' &> <%INIT> my $title; my $Ticket = LoadTicket($id); my $Status = $ARGS{DefaultStatus} if exists $ARGS{DefaultStatus}; my $Type = $m->scomp('Elements/Type', Ticket => $Ticket->Id); $Type =~ s/\s+$//; my $name; if ($Type eq 'Report') { $name = "Incident Report"; } else { $name = $Type; } if ($Status eq 'resolved') { $title = loc("Resolve [_1] #[_2] ([_3])", $name, $Ticket->id, $Ticket->Subject); } elsif ($Status eq 'rejected') { $title = loc("Reject [_1] #[_2] ([_3])", $name, $Ticket->id, $Ticket->Subject); } else { $title = loc("Update [_1] #[_2] ([_3])", $name, $Ticket->id, $Ticket->Subject); } my $CanRespond = 0; my $CanComment = 0; $DefaultStatus = $Ticket->Status() unless ($DefaultStatus); # Things needed in the template - we'll do the processing here, just # for the convenience: my ($CommentDefault, $ResponseDefault); if (($Action eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) { $CommentDefault = "SELECTED"; } else { $ResponseDefault = "SELECTED"; } my $Subject; if ($ARGS{'UpdateSubject'}) { $Subject = $ARGS{'UpdateSubject'}; } elsif ($Ticket) { $Subject = $Ticket->Subject; } my $replystring = lc($RT::ReplyString); if ( $Action eq 'Respond' && $replystring && lc(substr($Subject, 0, length($replystring))) ne $replystring) { $Subject = $RT::ReplyString . " " . $Subject; } $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or $Ticket->CurrentUserHasRight('ModifyTicket') ); $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or $Ticket->CurrentUserHasRight('ModifyTicket') ); # {{{ deal with deleting uploaded attachments foreach my $key (keys %ARGS) { if ($key =~ m/^DeleteAttach-(.+)$/) { delete $session{'Attachments'}{$1}; } $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; } # {{{ store the uploaded attachment in session if ($ARGS{'Attach'}) { # attachment? $session{'Attachments'} = {} unless defined $session{'Attachments'}; # strip leading directories $ARGS{'Attach'} =~ s#^.*[\\/]##; my $attachment = MakeMIMEEntity( Subject => "$ARGS{'Attach'}", Body => "", AttachmentFieldName => 'Attach' ); $session{'Attachments'} = { %{$session{'Attachments'} || {}}, $ARGS{'Attach'} => $attachment }; } # }}} # delete temporary storage entry to make WebUI clean unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { delete $session{'Attachments'}; } # }}} if ( exists $ARGS{SubmitTicket} ) { $m->comp('/RTIR/Display.html', %ARGS); $m->abort(); } my $State = $m->scomp("/RTIR/Elements/ShowRTIRField", Ticket => $Ticket, Name => 'State'); <%ARGS> $id => undef $DefaultStatus => undef $Action => undef