[rt-users] History display order

John Gedeon jgedeon at qualcomm.com
Thu Jan 9 12:57:59 EST 2003


What I ended up doing is the following.

In the file Ticket/History.html
...
  <& /Ticket/Elements/ShowHistory , Ticket => $Ticket,  ShowHeaders => 
$ARGS{'ShowHeaders'},
                                                       URIFile => 
'History.html'
                                              +       , Order => 
$ARGS{'Order'} &>
...
in file Ticket/Elemenets/ShowHistory:
...
  %  if ($ShowHeaders ...
  FullHeaders</a>]
  % }
   % if ($Order eq 'asc') {
   [<a href = "<%$URIFile%>?id=<%Ticket->id>&Order=desc">Descending</a>]
   % } else {
   more options like that
   % }
  ....
  <%INIT>
    my $Transactios = $Ticket->Transactions;
+ $Transactions->OrderBy ( ALIAS => 'main', FIELD => 'Created' , ORDER => 
"$Order");
     my $i;
  </%INIT>
...
  <%ARGS>
   ...
    $ShowHeaders => undef
+ $Order => 'asc'
    $Collapsed => undef
    ...
  </%ARGS>

$Order is set by the link. by defaut its ASC and clicking the link makes it 
DESC and vice versa. (now if i can make it a user preference so that their 
preference can be saved that would be good.)

At 09:08 AM 1/9/2003, darren chamberlain wrote:
>* 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
>_______________________________________________
>rt-users mailing list
>rt-users at lists.fsck.com
>http://lists.fsck.com/mailman/listinfo/rt-users
>
>Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm


--
<>< Proverbs 3:5 "Trust in the Lord with all your heart and lean not on 
your own understanding;"




More information about the rt-users mailing list