[rt-users] History display order

darren chamberlain darren at boston.com
Thu Jan 9 12:08:02 EST 2003


* John Gedeon <jgedeon at qualcomm.com> [2003-01-09 11:58]:
> Is there a way to add a link or button which will reverse the order of how 
> the history is displayed?
> I have users who want both. I found that the default is set in 
> Transactios.pm but I can't seem to find a way to set that based on a 
> variable via the web.

Warning: I'm using an ancient version of rt2; locations in file may have
changed.

Look at $RT/WebRT/html/Tickets/Elements/ShowHistory, which does:

  %while (my $Transaction = $Transactions->Next) {
      <& ShowTransaction, ... &>
  %}

(I've trimmed significantly.)

You can just (conditionally) reverse the order of the transactions.
Replace the while line above with something like this:

  % my @transactions;
  % while (my $Transaction = $Transactions->Next) {
  %     push @transactions, $Transaction;
  % }
  % # $ARGV{'reverse'} is your parameter indicating reverse history order
  % if ($ARGS{'reverse'}) {  
  %     @transactions = reverse @transactions;
  % }

  % foreach my $Transaction (@transactions) {

And then continue with the rest of the template.

(darren)

-- 
I disapprove of what you say, but I will defend to the death your
right to say it.
    -- S.G. Tallentyre



More information about the rt-users mailing list