%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# %# This software is Copyright (c) 1996-2013 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 &> % $m->callback(CallbackName => 'BeforeActionList', ARGSRef => \%ARGS, Ticket => $Ticket); <& /Elements/ListActions, actions => \@results &>
<& /Elements/GnuPG/SignEncryptWidget:ShowIssues, self => $gnupg_widget &>
<&|/Widgets/TitleBox, title => loc('Ticket and Transaction') &> <& /Ticket/Elements/EditBasics, TicketObj => $Ticket, InTable => 1, fields => [ { name => 'Owner', comp => '/Elements/SelectOwner', args => { Name => "Owner", TicketObj => $Ticket, QueueObj => $Ticket->QueueObj, DefaultLabel => loc("[_1] (Unchanged)", $m->scomp( '/Elements/ShowUser', User => $Ticket->OwnerObj ) ), Default => $ARGS{'Owner'} || $Ticket->Owner || $session{'CurrentUser'}->id, } }, { name => 'Worked', comp => '/Elements/EditTimeValue', args => { Name => 'UpdateTimeWorked', Default => $ARGS{UpdateTimeWorked}||'', InUnits => $ARGS{'UpdateTimeWorked-TimeUnits'}||'minutes', } }, ], &> <& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $Ticket, InTable => 1, &>
<&|/l&>Update Type:
<&|/l&>Status: <% loc($Ticket->Status) %>
<& /Ticket/Elements/ShowSimplifiedRecipients, %ARGS, TicketObj => $Ticket &> % if (my $recips = $m->notes("DryRun-Recipients-".$Ticket->Id)) { " /> % } <&|/Widgets/TitleBox, title => loc('Message'), class => 'messagedetails' &> % $ARGS{IncludeSignature} = 0 if $Action ne 'Respond' && !RT->Config->Get('MessageBoxIncludeSignatureOnComment'); <& /RTIR/Elements/UpdateData, %ARGS, Ticket => $Ticket, Type => 'Incident', GnuPGWidget => $gnupg_widget &>
<&|/l&>Subject:
<& /Elements/Submit, Name => 'SubmitTicket' &>
<%INIT> my $Ticket = LoadTicket($id); $id = $ARGS{'id'} = $Ticket->Id; $m->callback(CallbackName => 'Initial', %ARGS, Ticket => $Ticket); my $Type = RT::IR::TicketType( Ticket => $Ticket ); my $title = loc("Update [_1] #[_2] ([_3])", $Type, $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' || ($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 (@results, $checks_failure); my $gnupg_widget = $m->comp('/Elements/GnuPG/SignEncryptWidget:new', Arguments => \%ARGS ); $m->comp( '/Elements/GnuPG/SignEncryptWidget:Process', self => $gnupg_widget, TicketObj => $Ticket, ); if ( $SubmitTicket ) { my $status = $m->comp('/Elements/GnuPG/SignEncryptWidget:Check', self => $gnupg_widget, TicketObj => $Ticket, ); $checks_failure = 1 unless $status; } if ( $SubmitTicket ) { my $status = $m->comp('/Elements/ValidateCustomFields', CustomFields => $Ticket->QueueObj->TicketTransactionCustomFields, ARGSRef => \%ARGS, NamePrefix => "Object-RT::Transaction--CustomField-", ); unless ( $status ) { push @results, loc( "Invalid value(s) of the custom fields" ); $checks_failure = 1; } } if ( $SubmitTicket ) { $checks_failure += RT::IR->FilterRTAddresses( ARGSRef => \%ARGS, Fields => { UpdateCc => 'Cc', UpdateBcc => 'Bcc' }, results => \@results, ); } if ( !$checks_failure && $SubmitTicket ) { my %checked = map {$_ => 1} grep {defined} @TxnSendMailTo; my @squelchlist = grep {not $checked{$_}} split /,/, $TxnRecipients; $ARGS{'SquelchMailTo'} = \@squelchlist if @squelchlist; } if ( !$checks_failure && $SubmitTicket ) { $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket); return $m->comp('/RTIR/Display.html', %ARGS); } <%ARGS> $id => undef $Status => undef $Action => '' @TxnSendMailTo => () $TxnRecipients => '' $SubmitTicket => undef