<&|/m/_elements/wrapper, title => loc('Update ticket #[_1]', $t->id) &> <& /m/_elements/ticket_menu, ticket => $t &> <& /Elements/ListActions, actions => \@results &>
<&|/Widgets/TitleBox &>
<&|/l&>Status:
<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", loc($t->Status)), Default => $ARGS{'Status'} || ($t->Status eq $DefaultStatus ? undef : $DefaultStatus)&>
<&|/l&>Owner:
<& /Elements/SelectOwner, Name => "Owner", TicketObj => $t, QueueObj => $t->QueueObj, DefaultLabel => loc("[_1] (Unchanged)", $t->OwnerObj->Name), Default => $ARGS{'Owner'} &>
<&|/l&>Worked: <& /Elements/EditTimeValue, Name => 'UpdateTimeWorked', Default => $ARGS{UpdateTimeWorked}||'', InUnits => $ARGS{'UpdateTimeWorked-TimeUnits'}||'minutes', &>

<&|/l&>Update Type:
<&|/l&>Subject:
% $m->callback( %ARGS, CallbackName => 'AfterSubject' );
<&|/l&>One-time Cc:<& /Elements/EmailInput, Name => 'UpdateCc', Size => '60', Default => $ARGS{UpdateCc} &>
<&|/l&>One-time Bcc:<& /Elements/EmailInput, Name => 'UpdateBcc', Size => '60', Default => $ARGS{UpdateBcc} &>
<&|/l&>Message:
% if (exists $ARGS{UpdateContent}) { % # preserve QuoteTransaction so we can use it to set up sane references/in/reply to % my $temp = $ARGS{'QuoteTransaction'}; % delete $ARGS{'QuoteTransaction'}; <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS&> % $ARGS{'QuoteTransaction'} = $temp; % } else { % my $IncludeSignature = 1; % $IncludeSignature = 0 if $Action ne 'Respond' && !RT->Config->Get('MessageBoxIncludeSignatureOnComment'); <& /Elements/MessageBox, Name=>"UpdateContent", IncludeSignature => $IncludeSignature, %ARGS &> % }
<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &>
<%INIT> my $CanRespond = 0; my $CanComment = 0; my $checks_failure = 0; my $title; my $t = LoadTicket($id); my @results; $m->callback( Ticket => $t, ARGSRef => \%ARGS, results => \@results, CallbackName => 'Initial' ); unless($DefaultStatus){ $DefaultStatus=($ARGS{'Status'} ||$t->Status()); } if ($DefaultStatus eq 'new'){ $DefaultStatus='open'; } if ($DefaultStatus eq 'resolved') { $title = loc("Resolve ticket #[_1] ([_2])", $t->id, $t->Subject); } else { $title = loc("Update ticket #[_1] ([_2])", $t->id, $t->Subject); } # Things needed in the template - we'll do the processing here, just # for the convenience: my ($CommentDefault, $ResponseDefault); if ($Action ne 'Respond') { $CommentDefault = qq[ selected="selected"]; $ResponseDefault = ""; } else { $CommentDefault = ""; $ResponseDefault = qq[ selected="selected"]; } $CanRespond = 1 if ( $t->CurrentUserHasRight('ReplyToTicket') or $t->CurrentUserHasRight('ModifyTicket') ); $CanComment = 1 if ( $t->CurrentUserHasRight('CommentOnTicket') or $t->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? my $attachment = MakeMIMEEntity( AttachmentFieldName => 'Attach' ); my $file_path = Encode::decode_utf8("$ARGS{'Attach'}"); $session{'Attachments'} = { %{$session{'Attachments'} || {}}, $file_path => $attachment, }; } # }}} # delete temporary storage entry to make WebUI clean unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { delete $session{'Attachments'}; } # }}} # check email addresses for RT's { foreach my $field ( qw(UpdateCc UpdateBcc) ) { my $value = $ARGS{ $field }; next unless defined $value && length $value; my @emails = Email::Address->parse( $value ); foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) { push @results, loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, loc(substr($field, 6)) ); $checks_failure = 1; $email = undef; } $ARGS{ $field } = join ', ', map $_->format, grep defined, @emails; } } if ( !$checks_failure && exists $ARGS{SubmitTicket} ) { return $m->comp('/m/ticket/show', TicketObj => $t, %ARGS); } <%ARGS> $id => undef $Action => 'reply' $DefaultStatus => undef