X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FModifyAll.html;h=20471ac4cc31afbcaa9c672e63f4344bba24478d;hp=cd9bb3891c0ff301e02b6710ceca08e0b856123f;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924 diff --git a/rt/share/html/Ticket/ModifyAll.html b/rt/share/html/Ticket/ModifyAll.html index cd9bb3891..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-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -46,16 +46,14 @@ %# %# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> -<& /Ticket/Elements/Tabs, - Ticket => $Ticket, - current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id, - Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> +<& /Elements/Tabs &> % $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket); <& /Elements/ListActions, actions => \@results &> -
+ % $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS ); + <&| /Widgets/TitleBox, title => loc('Modify ticket # [_1]', $Ticket->Id), class=>'ticket-info-basics' &> @@ -63,6 +61,7 @@ <& Elements/EditCustomFields, TicketObj => $Ticket &> +% $m->callback(CallbackName => 'AfterBasics', Ticket => $Ticket);
<&| /Widgets/TitleBox, title => loc('Dates'), class=>'ticket-info-dates'&> @@ -106,40 +105,15 @@ % $m->callback( %ARGS, CallbackName => 'AfterSubject' ); -% if (my $TxnCFs = $Ticket->TransactionCustomFields) { -% while (my $CF = $TxnCFs->Next()) { - -<% loc($CF->Name) %>: -<& /Elements/EditCustomField, - CustomField => $CF, - NamePrefix => "Object-RT::Transaction--CustomField-" - &><% $CF->FriendlyType %> - -% } # end if while -% } # end of if -% if (exists $session{'Attachments'}) { -<&|/l&>Attached file: - -<&|/l&>Check box to delete
-% foreach my $attach_name (keys %{$session{'Attachments'}}) { -<%$attach_name%>
-% } # end of foreach - - -% } # end of if - - <&|/l&>Attach: - - - -% $m->callback( %ARGS, CallbackName => 'AfterAttach' ); - - + <& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $Ticket, KeepValue => 1, &> + +<& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &> + <&|/l&>Content: -% if (defined $ARGS{UpdateContent} && length($ARGS{UpdateContent})) { +% if ( defined $ARGS{UpdateContent} && length $ARGS{UpdateContent} ) { <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0 &> % } else { <& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> @@ -179,35 +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 ($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; @@ -218,7 +164,12 @@ unless ($OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} ) my @owners =@{$ARGS{'Owner'}}; delete $ARGS{'Owner'}; foreach my $owner(@owners){ - $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner); + if (defined($owner) && $owner =~ /\D/) { + $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->Name eq $owner); + } + elsif (length $owner) { + $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner); + } } } @@ -240,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"); + } }