summaryrefslogtreecommitdiff
path: root/rt/share/html/Ticket/ModifyAll.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-06-04 00:16:28 -0700
committerIvan Kohler <ivan@freeside.biz>2013-06-04 00:16:28 -0700
commit7588a4ac90a9b07c08a3107cd1107d773be1c991 (patch)
tree55b8bedb5f899e705da0ba7f608267943bf89e94 /rt/share/html/Ticket/ModifyAll.html
parent98d2b25256055abb0dfcb9f586b434474fa97afd (diff)
RT 4.0.13
Diffstat (limited to 'rt/share/html/Ticket/ModifyAll.html')
-rwxr-xr-xrt/share/html/Ticket/ModifyAll.html45
1 files changed, 14 insertions, 31 deletions
diff --git a/rt/share/html/Ticket/ModifyAll.html b/rt/share/html/Ticket/ModifyAll.html
index 4ed393451..d36076cf2 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-2013 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -112,7 +112,7 @@
<tr>
<td class="labeltop"><&|/l&>Content</&>:</td>
<td class="entry">
-% 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");
+ }
}