X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FModifyAll.html;h=6fb79e4fe46a10bf61ce81b9ec21938472b599f1;hp=4ed3934518c5c420521a200cc154dbdde0e075bc;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500 diff --git a/rt/share/html/Ticket/ModifyAll.html b/rt/share/html/Ticket/ModifyAll.html index 4ed393451..6fb79e4fe 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-2014 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -112,7 +112,7 @@ <&|/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 +152,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 +190,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"); + } }