[Rt-commit] rt branch, 4.6/link-transaction-to-ticket-page, created. rt-4.4.4-649-g24ae104dbf

Michel Rodriguez michel at bestpractical.com
Thu Jan 9 09:56:43 EST 2020


The branch, 4.6/link-transaction-to-ticket-page has been created
        at  24ae104dbff9ff921bd0779b5ecdee76d257ee07 (commit)

- Log -----------------------------------------------------------------
commit 24ae104dbff9ff921bd0779b5ecdee76d257ee07
Author: michel <michel at bestpractical.com>
Date:   Wed Jan 8 20:35:54 2020 -0500

    Add a "Back to ticket" link in the edit menu for transaction display pages.

diff --git a/share/html/Elements/ShowHistoryHeader b/share/html/Elements/ShowHistoryHeader
index c12fce532e..a7b0d26a5b 100644
--- a/share/html/Elements/ShowHistoryHeader
+++ b/share/html/Elements/ShowHistoryHeader
@@ -51,6 +51,7 @@ $ShowHeaders       => 0
 $ShowTitle         => 1
 $ShowDisplayModes  => 1
 $ScrollShowHistory => 0
+$TicketLink        => ''
 </%ARGS>
 <%INIT>
 my $record_type = $Object->RecordType;
@@ -94,6 +95,10 @@ if ( $ShowDisplayModes or $ShowTitle or $ScrollShowHistory ) {
         }
     }
 
+    if ( $TicketLink ) {
+        push( @elements, qq{<a href="$TicketLink">} . loc( "Back to ticket" ) . q{</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/Transaction/Display.html b/share/html/Transaction/Display.html
index 36686f6922..a3a4bd8d8b 100644
--- a/share/html/Transaction/Display.html
+++ b/share/html/Transaction/Display.html
@@ -48,7 +48,10 @@
 <& /Elements/Header, Title => loc('Transaction #[_1]', $id) &>
 <& /Elements/Tabs &>
 
-<& /Elements/ShowHistoryHeader, Object => $txn, %ARGS &>
+<& /Elements/ShowHistoryHeader, Object => $txn,
+    TicketLink      => RT->Config->Get('WebPath') . '/Ticket/Display.html?id=' . $txn->ObjectId,
+    %ARGS
+&>
 
 <& /Elements/ShowTransaction, Transaction => $txn,
     DisplayPath     => RT->Config->Get('WebPath') . '/Ticket/Display.html',

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


More information about the rt-commit mailing list