[Rt-commit] rt branch, 4.6/reverse-transaction-order, repushed

Michel Rodriguez michel at bestpractical.com
Mon Jan 6 09:55:09 EST 2020


The branch 4.6/reverse-transaction-order was deleted and repushed:
       was d2b093fc27e4f91b3e8ffc918046464c7d8f5a88
       now 5fbf906b83ea1920ef7319d2420de1a1443b58a8

1: 4087b3a62b < -:  ------- Fixed templates so that ShowHeaders is passed as an argument, instead of getting it sometimes from %ARGS
2: d2b093fc27 ! 1: 5fbf906b83 Add a control to reverse the transaction display order on the current ticket.
    @@ -1,10 +1,10 @@
     Author: michel <michel at bestpractical.com>
     
    -    Add a control to reverse the time order on the current ticket
    +    Add a control to reverse the transaction display order on the current ticket.
         
    -        Added the option in the template.
    -        Passed the new parameter through the variousi layers of templates.
    -        Added an option to SortedTransactions to change the original order
    +    Add the option in the template.
    +    Pass the new parameter through the various layers of templates.
    +    Add an option to SortedTransactions to change the original order.
     
     diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
     --- a/lib/RT/Record.pm
    @@ -58,32 +58,39 @@
      $ShowDisplayModes  => 1
      $ScrollShowHistory => 0
     @@
    + </%INIT>
      <div class="history <% lc $record_type %>" id="<% $histid %>">
      <%perl>
    - $ShowHeaders   //= 0;
    --
    ++$ShowHeaders   //= 0;
     +$ReverseTransactionOrder //= 0;
      if ( $ShowDisplayModes or $ShowTitle or $ScrollShowHistory ) {
          my $title = $ShowTitle
                          ? loc('History')
     @@
    -                            loc("Show full headers") .
    -                            qq{</a>};
    +                          qq{<a href="#" id="LoadAllHistory">} .
    +                          loc('Load all history') .
    +                          qq{</a>} .
    ++                         ($ShowDisplayModes ? '—' : '') .
    +                          qq{</span>} );
    +     }
    + 
    +@@
              }
    -+
    -+        my @TransactionHeaders= ( loc( 'Oldest transaction first'), loc( 'Newest transaction first') );
    -+        my $Order = (RT->Config->Get("OldestTransactionsFirst", $Object->CurrentUser) xor $ReverseTransactionOrder);
    -+        my $TransactionHeader= $TransactionHeaders[$Order];
    -+
    -+        my $switched_order = 1 - $ReverseTransactionOrder;
    -+        $titleright .= '—' if $titleright;
    -+        $titleright .= qq{<a href="?ReverseTransactionOrder=$switched_order;ForceShowHistory=1;ShowHeaders=$ShowHeaders;id=} .
    -+                           $Object->id.qq{#$histid">} .
    -+                           $TransactionHeader .
    -+                           qq{</a>};
          }
      
    - </%perl>
    ++    my @TransactionHeaders= ( loc( 'Oldest transaction first'), loc( 'Newest transaction first') );
    ++    my $Order = (RT->Config->Get("OldestTransactionsFirst", $Object->CurrentUser) xor $ReverseTransactionOrder);
    ++    my $TransactionHeader= $TransactionHeaders[$Order];
    ++
    ++    my $switched_order = 1 - $ReverseTransactionOrder;
    ++    push( @elements, qq{<a href="?ReverseTransactionOrder=$switched_order;ForceShowHistory=1;ShowHeaders=$ShowHeaders;id=} .
    ++                     $Object->id.qq{#$histid">} .
    ++                     $TransactionHeader .
    ++                     qq{</a>} );
    ++
    +     # build the new link
    +     my $alt = loc('Edit');
    +     my $titleright = qq{<div class="btn-group dropdown"><a id="history-dropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span></a><ul class="dropdown-menu dropdown-menu-right">};
     
     diff --git a/share/html/Elements/ShowHistoryPage b/share/html/Elements/ShowHistoryPage
     --- a/share/html/Elements/ShowHistoryPage
    @@ -103,9 +110,10 @@
     --- a/share/html/Helpers/TicketHistory
     +++ b/share/html/Helpers/TicketHistory
     @@
    + %# END BPS TAGGED BLOCK }}}
      <%ARGS>
      $id
    - $ShowHeaders => 0
    ++$ShowHeaders => 0
     +$ReverseTransactionOrder => 0
      </%ARGS>
      <%INIT>
    @@ -169,6 +177,14 @@
                AttachmentContent => $attachment_content
          &>
     @@
    + <%ARGS>
    + $TicketObj => undef
    + $ShowHeaders => 0
    ++$ReverseTransactionOrder => 0
    + $HideUnsetFields => RT->Config->Get('HideUnsetFieldsOnDisplay', $session{CurrentUser})
    + $ForceShowHistory => 0
    + </%ARGS>
    +@@
          Arguments => { id => $TicketObj->id },
      );
      
    @@ -182,17 +198,20 @@
     --- a/share/html/Ticket/Elements/ScrollShowHistory
     +++ b/share/html/Ticket/Elements/ScrollShowHistory
     @@
    + %# END BPS TAGGED BLOCK }}}
      <%ARGS>
      $Ticket
    - $ShowHeaders => 0
    ++$ShowHeaders => 0
     +$ReverseTransactionOrder => 0
      </%ARGS>
      
      <%INIT>
     @@
    +         $m->comp('/Elements/QueryString', %params, id => $Ticket->id );
      
      my %extra_args = map { $_ => $ARGS{$_} // 1 } qw/ShowDisplayModes ShowTitle ScrollShowHistory/;
    - $extra_args{ShowHeaders} = $ShowHeaders;
    +-$extra_args{ShowHeaders} = $ARGS{ShowHeaders};
    ++$extra_args{ShowHeaders} = $ShowHeaders;
     +$extra_args{ReverseTransactionOrder} = $ReverseTransactionOrder;
      
      $m->callback( CallbackName => 'ExtraShowHistoryArguments', Ticket => $Ticket, ExtraArgs => \%extra_args );



More information about the rt-commit mailing list