[Rt-commit] rt branch, 4.6/link-transaction-to-ticket-page, repushed
Michel Rodriguez
michel at bestpractical.com
Wed Feb 26 15:12:04 EST 2020
The branch 4.6/link-transaction-to-ticket-page was deleted and repushed:
was 4c3feb48236d464f983165543dba38cce0f1ebab
now a220b8637ddbb9f01b8477be34d8620f4a373afc
1: 4f8bb5043 ! 1: a220b8637 Add link back to the ticket from a single transaction page.
@@ -1,6 +1,9 @@
Author: michel <michel at bestpractical.com>
- Add link back to the ticket to a single transaction page.
+ Add link back to the ticket from a single transaction page.
+
+ The button goes in the top menu.
+ Add a hash of button texts to make translation easier.
diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
--- a/lib/RT/Interface/Web/MenuBuilder.pm
@@ -27,9 +30,12 @@
+ my $object = $txn->Object;
+ if ( $object ) {
+ my( $object_type ) = $object->RecordType;
++ # the button_text is here to make translation support easier: "Return to $object_type" does not have a
++ # single translation in many languages
++ my %button_text = ( Ticket => loc( "Return to ticket" ) );
+ # This assumes that the object type can be used to describe the object (in "Back to $object_type")
+ # and that displaying the object is done in /$object_type/Display.html?id=<id>
-+ $page->child( object_type => title => loc( "Back to [_1]", loc( $object_type ) ), path => "/$object_type/Display.html?id=" . $object->Id );
++ $page->child( object_type => title => $button_text{$object_type}, path => "/$object_type/Display.html?id=" . $object->Id );
+ }
+ }
+ }
@@ -39,3 +45,14 @@
my $args = '';
my $has_query = '';
+diff --git a/share/html/Ticket/History.html b/share/html/Ticket/History.html
+--- a/share/html/Ticket/History.html
++++ b/share/html/Ticket/History.html
+@@
+ ShowHeaders => $ARGS{'ShowHeaders'},
+ Attachments => $attachments,
+ AttachmentContent => $attachment_content,
+- DisplayPath => 'History.html',
+ &>
+
+ % $m->callback( %ARGS, CallbackName => 'AfterShowHistory', Ticket => $Ticket );
2: 912e74578 < -: ------- Generate links to single transaction display in the Ticket history page.
3: 4c3feb482 < -: ------- Add a hash of button texts to make translation easier.
More information about the rt-commit
mailing list