%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
<& /Elements/ListActions, actions => \@Actions &>
<& Elements/ShowUpdateStatus, Ticket => $TicketObj &>
+<& Elements/ShowDependencyStatus, Ticket => $TicketObj &>
% $m->callback( %ARGS, Ticket => $TicketObj, Transactions => $transactions, Attachments => $attachments, CallbackName => 'BeforeShowSummary' );
<div class="summary">
% $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
$id => undef
$TicketObj => undef
$ShowHeaders => 0
-$Collapsed => undef
$ForceShowHistory => 0
+$RedirectToBasics => 0
</%ARGS>
<%INIT>
}
-my (@Actions, $Tickets, $title);
+my (@Actions, $title);
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 {
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.".");
}
my $SkipProcessing;
$m->callback( CallbackName => 'BeforeProcessArguments',
- TicketObj => $TicketObj, Tickets => $Tickets,
+ TicketObj => $TicketObj,
ActionsRef => \@Actions, ARGSRef => \%ARGS,
SkipProcessing => \$SkipProcessing );
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 );
$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(
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'})) {
$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};
}
</%INIT>