X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fhtml%2FTicket%2FElements%2FShowHistory;h=878e2535c69f7e8f5a5387bf303602a8e4ea7563;hp=37b670d822f530bc4f7c43df0aafefab6e44bcbd;hb=9c68254528b6f2c7d8c1921b452fa56064783782;hpb=d39d52aac8f38ea9115628039f0df5aa3ac826de diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory index 37b670d82..878e2535c 100644 --- a/rt/html/Ticket/Elements/ShowHistory +++ b/rt/html/Ticket/Elements/ShowHistory @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%perl> if ($ShowDisplayModes or $ShowTitle) { my $title; @@ -104,8 +104,8 @@ while ( my $Transaction = $Transactions->Next ) { $m->comp( 'ShowTransaction', %ARGS, - AttachPath => $AttachPath, - UpdatePath => $UpdatePath, + AttachPath => $AttachPath, + UpdatePath => $UpdatePath, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, @@ -116,6 +116,10 @@ while ( my $Transaction = $Transactions->Next ) { AttachmentContent => $trans_content, LastTransaction => $Transactions->IsLast ); + +# manually flush the content buffer after each txn, so the user sees +# some update +$m->flush_buffer(); } @@ -127,15 +131,21 @@ while ( my $Transaction = $Transactions->Next ) { my $Transactions = new RT::Transactions($session{'CurrentUser'}); if ($Tickets) { while (my $t = $Tickets->Next) { - $Transactions->Limit(FIELD => 'Ticket', - OPERATOR => '=', - VALUE => $t->Id); + $Transactions->LimitToTicket($t->id); } } else { $Transactions = $Ticket->Transactions; } -my $i; + +my $OldestFirst = $RT::OldestTransactionsFirst? 'ASC': 'DESC'; +$Transactions->OrderByCols( { FIELD => 'Created', + ORDER => $OldestFirst }, + { FIELD => 'id', + ORDER => $OldestFirst }, + ); + +my $i; $Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket, Tickets => $Tickets || undef); $AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket); @@ -153,5 +163,4 @@ $ShowDisplayModes => 1 $ShowTitleBarCommands => 1 $AttachPath => $RT::WebPath."/Ticket/Attachment" $UpdatePath => $RT::WebPath."/Ticket/Update.html" -