[Rt-commit] rt branch, 4.4/showhistory-mode-arg, created. rt-4.4.3-200-g0636e4657
Jim Brandt
jbrandt at bestpractical.com
Thu Feb 28 14:55:55 EST 2019
The branch, 4.4/showhistory-mode-arg has been created
at 0636e46571a58c003bcd4db11882f31aab3263d8 (commit)
- Log -----------------------------------------------------------------
commit 0636e46571a58c003bcd4db11882f31aab3263d8
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Wed Feb 27 10:13:37 2019 -0500
Accept a ShowHistory arg as an override for the default setting
This allows a different loading mode for the history for
an single ticket display. This is useful for debugging when
the source HTML is needed for transactions and the default
scroll mode shows only "Loading...". It is also useful for
the TicketToPDF extension which needs to load the entire history
to generate a PDF.
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index e4b65ba2b..b497618e8 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1427,7 +1427,7 @@ our %WHITELISTED_COMPONENT_ARGS = (
# Action->Extract Article on a ticket's menu
'/Articles/Article/ExtractIntoClass.html' => ['Ticket'],
# Only affects display
- '/Ticket/Display.html' => ['HideUnsetFields'],
+ '/Ticket/Display.html' => ['HideUnsetFields','ShowHistory'],
);
# Components which are blacklisted from automatic, argument-based whitelisting.
diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index 87a663ebf..010142fee 100644
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -78,7 +78,7 @@ my $titleright = qq{<a href="$url_html" data-show-label="$show_label" data-hide-
% $m->callback( Ticket => $TicketObj, %ARGS, Transactions => $transactions, Attachments => $attachments, CallbackName => 'BeforeShowHistory' );
-% my $ShowHistory = RT->Config->Get("ShowHistory", $session{'CurrentUser'});
+% $ShowHistory //= RT->Config->Get("ShowHistory", $session{'CurrentUser'});
% if ($ShowHistory eq "scroll") {
<& /Ticket/Elements/ScrollShowHistory,
Ticket => $TicketObj,
@@ -116,6 +116,7 @@ $TicketObj => undef
$ShowHeaders => 0
$HideUnsetFields => RT->Config->Get('HideUnsetFieldsOnDisplay', $session{CurrentUser})
$ForceShowHistory => 0
+$ShowHistory => undef
</%ARGS>
<%INIT>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list