%# 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=$id", Title => $title &> % $m->callback(CallbackName => 'BeforeActionList', ARGSRef => \%ARGS, Ticket => $Ticket);
% if ( $ARGS{'Status'} ) { % } % if ($Type eq 'Report' and $ARGS{'DefaultStatus'} eq 'rejected') { % my $query = "Queue = 'Incidents' AND HasMember = $id"; % my $incidents = new RT::Tickets($session{'CurrentUser'}); % $incidents->FromSQL($query); % while (my $member = $incidents->Next) { % } % } % if ($cannot_sign) { <& /Elements/GnuPGSignIssues &> % } <& /Elements/GnuPGKeyIssues, Issues => \@gnupg_keys_issues &> % foreach my $type (qw(Requestors Cc AdminCc)) { % }
<&|/l&>Correspondents
  <%loc($type)%>:
    % my $people = $Ticket->$type()->UserMembersObj; % while (my $person = $people->Next) {
  • <& /RTIR/ShowUser, id => $person->id &>
  • % }

<& /RTIR/Elements/UpdateData, Ticket => $Ticket, Type => 'Incident', %ARGS &>
<&|/l&>State: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'State' &>
<&|/l&>Update Type:
<&|/l&>Owner: <& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{Owner}||$Ticket->Owner()||$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); $id = $ARGS{'id'} = $Ticket->Id; $m->callback(CallbackName => 'Initial', %ARGS, Ticket => $Ticket); my $Type = RT::IR::TicketType( Ticket => $Ticket ); my $name; if ($Type eq 'Report') { $name = "Incident Report"; } else { $name = $Type; } $DefaultStatus ||= $ARGS{'Status'} || ''; $ARGS{'Status'} ||= $DefaultStatus; # XXX: we should get rid of the DefaultStatus $DefaultStatus = 'open' if $DefaultStatus eq 'new'; if ( $DefaultStatus eq 'resolved' ) { $title = loc("Resolve [_1] #[_2] ([_3])", $name, $id, $Ticket->Subject); } elsif ( $DefaultStatus eq 'rejected' ) { if ( $Type eq 'Incident' ) { $title = loc("Abandon [_1] #[_2] ([_3])", $name, $id, $Ticket->Subject); } else { $title = loc("Reject [_1] #[_2] ([_3])", $name, $id, $Ticket->Subject); } } else { $title = loc("Update [_1] #[_2] ([_3])", $name, $id, $Ticket->Subject); } my $CanRespond = 0; my $CanComment = 0; # 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 = $ARGS{'UpdateSubject'} || $Ticket->Subject; my $replystring = lc(RT->Config->Get('ReplyString')); if ( $Action eq 'Respond' && $replystring && lc(substr($Subject, 0, length($replystring))) ne $replystring) { $Subject = RT->Config->Get('ReplyString') . " " . $Subject; } $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or $Ticket->CurrentUserHasRight('ModifyTicket') ); $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or $Ticket->CurrentUserHasRight('ModifyTicket') ); $m->comp( '/RTIR/Create.html:ProcessAttachments', %ARGS ); my $checks_failure; # check to see if we have a good passphrase my $cannot_sign = 0; if ( $ARGS{'SubmitTicket'} && $ARGS{'Sign'} ) { my $address = $ARGS{'UpdateType'} eq "private" ? $Ticket->QueueObj->CommentAddress : $Ticket->QueueObj->CorrespondAddress; if (!RT::Crypt::GnuPG::DrySign($address, "x")) { $cannot_sign = 1; $checks_failure = 1; } } my @gnupg_keys_issues; if ( $ARGS{'SubmitTicket'} && $ARGS{'Encrypt'} ) { my @recipients = $m->comp( '/Ticket/Elements/PreviewScrips:GetRecipients', %ARGS, TicketObj => $Ticket ); RT::Crypt::GnuPG::UseKeyForEncryption( map { (/^UseKey-(.*)$/)[0] => $ARGS{ $_ } } grep $ARGS{$_} && /^UseKey-/, keys %ARGS ); my $status; ($status, @gnupg_keys_issues) = RT::Crypt::GnuPG::CheckRecipients( @recipients ); $checks_failure = 1 unless $status; } if ( !$checks_failure && exists $ARGS{SubmitTicket} ) { $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket); return $m->comp('/RTIR/Display.html', %ARGS); } <%ARGS> $id => undef $DefaultStatus => undef $Action => undef