merging RT 4.0.6
[freeside.git] / rt / share / html / Articles / Elements / ShowTopicLink
1 <%args>
2 $Topic
3 $Class => 0
4 </%args>
5 % if ($Link) {
6 <a href="Topics.html?id=<% $Topic->Id %>&class=<% $Class %>">\
7 % }
8 <% $Topic->Name() || loc("(no name)") %>\
9 % if ($Topic->Description) {
10 : <% $Topic->Description %>
11 % }
12
13 % if ( $Articles->Count ) {
14  (<&|/l, $Articles->Count &>[quant,_1,article]</&>)
15 % }
16
17 % if ($Link) {
18 </a>
19 % }
20
21 <%init>
22 my $Articles = RT::ObjectTopics->new( $session{'CurrentUser'} );
23 $Articles->Limit( FIELD => 'ObjectType', VALUE => 'RT::Article' );
24 $Articles->Limit( FIELD => 'Topic',      VALUE => $Topic->Id );
25
26 my $Link = $Topic->Children->Count || $Articles->Count;
27 </%init>