X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FModifyAll.html;h=20471ac4cc31afbcaa9c672e63f4344bba24478d;hp=4ed3934518c5c420521a200cc154dbdde0e075bc;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916 diff --git a/rt/share/html/Ticket/ModifyAll.html b/rt/share/html/Ticket/ModifyAll.html index 4ed393451..20471ac4c 100755 --- a/rt/share/html/Ticket/ModifyAll.html +++ b/rt/share/html/Ticket/ModifyAll.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -53,6 +53,7 @@
% $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS ); + <&| /Widgets/TitleBox, title => loc('Modify ticket # [_1]', $Ticket->Id), class=>'ticket-info-basics' &> @@ -105,14 +106,14 @@ - <& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $Ticket &> + <& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $Ticket, KeepValue => 1, &> <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &> <&|/l&>Content: -% if (defined $ARGS{UpdateContent} && length($ARGS{UpdateContent} && !grep { /Message recorded/ } @results )) { +% if ( defined $ARGS{UpdateContent} && length $ARGS{UpdateContent} ) { <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0 &> % } else { <& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> @@ -152,32 +153,7 @@ $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or $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 ( defined $ARGS{'Attach'} && length $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'}; -} - +ProcessAttachments(ARGSRef => \%ARGS); $m->callback( TicketObj => $Ticket, ARGSRef => \%ARGS ); my @results; @@ -215,11 +191,19 @@ unless ($OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} ) $Ticket->ApplyTransactionBatch; -# If they've gone and moved the ticket to somewhere they can't see, etc... -# TODO: display the results, even if we can't display the ticket. +MaybeRedirectForResults( + Actions => \@results, + Path => "/Ticket/ModifyAll.html", + Arguments => { id => $Ticket->id }, +); +# If they've gone and moved the ticket to somewhere they can't see, etc... unless ($Ticket->CurrentUserHasRight('ShowTicket')) { - Abort("No permission to view ticket"); + if (@results) { + Abort("A change was applied successfully, but you no longer have permissions to view the ticket", Actions => \@results); + } else { + Abort("No permission to view ticket"); + } }