X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FDisplay.html;h=3b13efda0cfcf7979a6571808fcc3cea6f25d3d0;hb=7322f2afedcc2f427e997d1535a503613a83f088;hp=0a29c9763ec1b1eda85b96439e4d924db0755a7c;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;p=freeside.git diff --git a/rt/share/html/Ticket/Display.html b/rt/share/html/Ticket/Display.html index 0a29c9763..3b13efda0 100755 --- a/rt/share/html/Ticket/Display.html +++ b/rt/share/html/Ticket/Display.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -54,6 +54,7 @@ <& /Elements/ListActions, actions => \@Actions &> <& Elements/ShowUpdateStatus, Ticket => $TicketObj &> +<& Elements/ShowDependencyStatus, Ticket => $TicketObj &> % $m->callback( %ARGS, Ticket => $TicketObj, Transactions => $transactions, Attachments => $attachments, CallbackName => 'BeforeShowSummary' );
@@ -65,16 +66,21 @@ % $m->callback( Ticket => $TicketObj, %ARGS, Transactions => $transactions, Attachments => $attachments, CallbackName => 'BeforeShowHistory' ); -% if (not $ForceShowHistory and RT->Config->Get( 'DeferTransactionLoading', $session{'CurrentUser'} )) { +% my $ShowHistory = RT->Config->Get("ShowHistory", $session{'CurrentUser'}); +% if ($ShowHistory eq "delay") { + <& /Ticket/Elements/DelayShowHistory, + Ticket => $TicketObj, + ShowHeaders => $ARGS{'ShowHeaders'}, + &> +% } elsif (not $ForceShowHistory and $ShowHistory eq "click") { <& /Ticket/Elements/ClickToShowHistory, Ticket => $TicketObj, + ShowHeaders => $ARGS{'ShowHeaders'}, &> % } else { - <& /Ticket/Elements/ShowHistory , - Ticket => $TicketObj, - Tickets => $Tickets, + <& /Elements/ShowHistory , + Object => $TicketObj, Transactions => $transactions, - Collapsed => $ARGS{'Collapsed'}, ShowHeaders => $ARGS{'ShowHeaders'}, Attachments => $attachments, AttachmentContent => $attachment_content @@ -92,8 +98,8 @@ $id => undef $TicketObj => undef $ShowHeaders => 0 -$Collapsed => undef $ForceShowHistory => 0 +$RedirectToBasics => 0 <%INIT> @@ -107,7 +113,7 @@ if ( ! $ARGS{'NoRedirect'} && RT::Interface::Web->MobileClient()) { } -my (@Actions, $Tickets, $title); +my (@Actions, $title); unless ($id || $TicketObj) { @@ -115,7 +121,7 @@ unless ($id || $TicketObj) { } if ($ARGS{'id'} eq 'new') { - # {{{ Create a new ticket + # Create a new ticket # Massage customer IDs into member links. my @cust_uris = map { @@ -135,10 +141,7 @@ if ($ARGS{'id'} eq 'new') { Abort('You have no permission to create tickets in that queue.'); } - ($TicketObj, @Actions) = CreateTicket( - Attachments => delete $session{'Attachments'}, - %ARGS, - ); + ($TicketObj, @Actions) = CreateTicket( %ARGS ); unless ( $TicketObj->CurrentUserHasRight('ShowTicket') ) { Abort("No permission to view newly created ticket #".$TicketObj->id."."); } @@ -150,7 +153,7 @@ if ($ARGS{'id'} eq 'new') { my $SkipProcessing; $m->callback( CallbackName => 'BeforeProcessArguments', - TicketObj => $TicketObj, Tickets => $Tickets, + TicketObj => $TicketObj, ActionsRef => \@Actions, ARGSRef => \%ARGS, SkipProcessing => \$SkipProcessing ); @@ -168,31 +171,30 @@ if ($ARGS{'id'} eq 'new') { ARGSRef => \%ARGS, Actions => \@Actions); - $ARGS{UpdateAttachments} = $session{'Attachments'}; - push @Actions, - ProcessUpdateMessage( + push @Actions, ProcessUpdateMessage( ARGSRef => \%ARGS, Actions => \@Actions, TicketObj => $TicketObj, - ); - delete $session{'Attachments'}; + ); #Process status updates push @Actions, ProcessTicketWatchers(ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketLinks( ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketDates( ARGSRef => \%ARGS, TicketObj => $TicketObj ); - push @Actions, ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS, TicketObj => $TicketObj ); + push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef => \%ARGS, TicketObj => $TicketObj ); # If this fails due to required fields being empty, it will set # notes('RedirectToBasics'). push @Actions, ProcessTicketStatus( ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketReminders( ARGSRef => \%ARGS, TicketObj => $TicketObj ); - # XXX: we shouldn't block actions here if user has no right to see the ticket, - # but we should allow him to see actions he has done unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { - Abort("No permission to view ticket"); + if (@Actions) { + Abort("A change was applied successfully, but you no longer have permissions to view the ticket", Actions => \@Actions); + } else { + Abort("No permission to view ticket"); + } } if ( $ARGS{'MarkAsSeen'} ) { $TicketObj->SetAttribute( @@ -210,13 +212,13 @@ $title = loc("Ticket #[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject || ''); $m->callback( CallbackName => 'BeforeDisplay', TicketObj => \$TicketObj, - Tickets => \$Tickets, Actions => \@Actions, title => \$title, ARGSRef => \%ARGS, ); # This code does automatic redirection if any updates happen. +$m->notes('RedirectToBasics' => 1) if $RedirectToBasics; my $path = '/Ticket/'. ( $m->notes('RedirectToBasics') ? 'Modify.html' : 'Display.html' ); MaybeRedirectForResults( @@ -229,10 +231,9 @@ MaybeRedirectForResults( Arguments => { id => $TicketObj->id }, ); -# Get the transactoins before the attachments, for great ACL justice -my $transactions = $m->comp('Elements/FindTransactions',Ticket => $TicketObj, Tickets => $Tickets || undef); -my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj, Tickets => $Tickets); -my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => $TicketObj); +my $transactions = $TicketObj->SortedTransactions; +my $attachments = $TicketObj->Attachments; +my $attachment_content = $TicketObj->TextAttachments; my %link_rel; if (defined $session{'tickets'} and ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'})) { @@ -240,6 +241,6 @@ if (defined $session{'tickets'} and ($ARGS{'Query'} or $session{'CurrentSearchHa $link_rel{first} = "Ticket/Display.html?id=" . $item_map->{first} if $item_map->{$TicketObj->Id}{prev}; $link_rel{prev} = "Ticket/Display.html?id=" . $item_map->{$TicketObj->Id}{prev} if $item_map->{$TicketObj->Id}{prev}; $link_rel{next} = "Ticket/Display.html?id=" . $item_map->{$TicketObj->Id}{next} if $item_map->{$TicketObj->Id}{next}; - $link_rel{last} = "Ticket/Display.html?id=" . $item_map->{last} if $item_map->{$TicketObj->Id}{next}; + $link_rel{last} = "Ticket/Display.html?id=" . $item_map->{last} if $item_map->{$TicketObj->Id}{next} && $item_map->{last}; }