<%INIT>
my $request_path = $HTML::Mason::Commands::r->path_info;
$request_path =~ s!/{2,}!/!g;

# the following request paths are used
# /SelfService/Display.html:  RT 4.0+ SelfService
# /Ticket/Display.html:       RT 4.0 and RT 4.2+ with $ShowHistory config = always
# /Helpers/TicketHistory:     RT 4.2+ with $ShowHistory config != always and scroll
# /Helpers/TicketHistoryPage: RT 4.4+ with $ShowHistory config = scroll
return unless $request_path =~ m{^/(?:(?:SelfService|Ticket)/Display\.html|Helpers/TicketHistory)};

my @types = RT->Config->Get('HistoryFilterTypes', $session{'CurrentUser'});
return unless $types[0];
@types = @{ $types[0] };
$$skip = 1
    if not grep {$_ eq $Transaction->Type} @types;
</%INIT>
<%ARGS>
$Transaction
$skip
</%ARGS>
