[Rt-commit] rt branch, 5.0/reverse-transaction-history, updated. rt-5.0.0alpha1-100-g7361eacee8

Jim Brandt jbrandt at bestpractical.com
Fri Apr 10 11:24:09 EDT 2020


The branch, 5.0/reverse-transaction-history has been updated
       via  7361eacee8bf1c707f79e04828f9308ca5ab31ee (commit)
      from  d2e716c0dcb121d82ea32ddef2ea576259c8236e (commit)

Summary of changes:
 share/html/Elements/ShowHistoryHeader | 12 ++++++++----
 share/html/Transaction/Display.html   |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 7361eacee8bf1c707f79e04828f9308ca5ab31ee
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Apr 10 11:22:13 2020 -0400

    Add a parameter to give context to history header
    
    ShowHistoryHeader can now be called from a full transaction
    history listing or an individual transaction. Add a flag
    to explicitly indicate the single transaction context and
    hide options that might not be applicable.

diff --git a/share/html/Elements/ShowHistoryHeader b/share/html/Elements/ShowHistoryHeader
index 6c8464759c..8eb69f404f 100644
--- a/share/html/Elements/ShowHistoryHeader
+++ b/share/html/Elements/ShowHistoryHeader
@@ -51,6 +51,7 @@ $ShowHeaders       => 0
 $ShowTitle         => 1
 $ShowDisplayModes  => 1
 $ScrollShowHistory => 0
+$SingleTransaction => 0
 </%ARGS>
 <%INIT>
 my $record_type = $Object->RecordType;
@@ -105,10 +106,13 @@ if ( $ShowDisplayModes or $ShowTitle or $ScrollShowHistory ) {
         }
     }
 
-    push( @elements, qq{<a href="?ForceShowHistory=1;ReverseTxns=$reverse_txns;id=} .
-                     $Object->id.qq{#$histid">} .
-                     loc("Reverse History Order") .
-                     qq{</a>} );
+    # Don't need to reverse history when showing a single transaction
+    unless ( $SingleTransaction ) {
+        push( @elements, qq{<a href="?ForceShowHistory=1;ReverseTxns=$reverse_txns;id=} .
+                         $Object->id.qq{#$histid">} .
+                         loc("Reverse History Order") .
+                         qq{</a>} );
+    }
 
     # build the new link
     my $alt = loc('Edit');
diff --git a/share/html/Transaction/Display.html b/share/html/Transaction/Display.html
index 36686f6922..0ce1998e5a 100644
--- a/share/html/Transaction/Display.html
+++ b/share/html/Transaction/Display.html
@@ -48,7 +48,7 @@
 <& /Elements/Header, Title => loc('Transaction #[_1]', $id) &>
 <& /Elements/Tabs &>
 
-<& /Elements/ShowHistoryHeader, Object => $txn, %ARGS &>
+<& /Elements/ShowHistoryHeader, Object => $txn, SingleTransaction => 1, %ARGS &>
 
 <& /Elements/ShowTransaction, Transaction => $txn,
     DisplayPath     => RT->Config->Get('WebPath') . '/Ticket/Display.html',

-----------------------------------------------------------------------


More information about the rt-commit mailing list