<&| /Widgets/TitleBox,
    title          => loc("Articles"),
    title_href     => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id, 
    titleright_raw => $box_actions,
    class          => 'ticket-info-articles',
&>

<& /Elements/CollectionList,
    Collection   => $articles,
    Format       => $format,
    ShowHeader   => 0,
&>

</&>
<%ARGS>
$Ticket
</%ARGS>
<%INIT>
my $id = $Ticket->id;

my $articles = RT::Articles->new( $session{'CurrentUser'} );
$articles->LimitReferredToBy( $Ticket->URI );

my $format = q{
    '<a href="__WebPath__/Articles/Article/Display.html?id=__id__">__id__</a>/TITLE:#',
    '<a href="__WebPath__/Articles/Article/Display.html?id=__id__">__Name__</a>/TITLE:Name',
    __Summary__,
};

my $box_actions = '';
if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
    my $web_path = RT->Config->Get('WebPath');
    my $qs = $m->comp("/Elements/QueryString",
        "RefersTo-new" => "t:$id",
        next => $web_path."/RTIR/Display.html?id=$id"
    );
    $box_actions = join '&nbsp;'x3,
        qq{<a href="$web_path/Articles/Article/PreCreate.html?$qs">}. loc('Create') .q{</a>},
        qq{<a href="$web_path/RTIR/Link/Articles.html?id=$id">}. loc('Link') .q{</a>},
    ;
}
</%INIT>
