summaryrefslogtreecommitdiff
path: root/rt/share/html/Articles/Elements/ShowTopicLink
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-30 01:03:13 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-30 01:03:13 -0700
commitf3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7 (patch)
treee5e9a077260613e6117d4697dd2985abd9b03d34 /rt/share/html/Articles/Elements/ShowTopicLink
parentcf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085 (diff)
parentcd3eb95ed1f3dc3e04cfc2b3b405f75b3ab086da (diff)
merging RT 4.0.6
Diffstat (limited to 'rt/share/html/Articles/Elements/ShowTopicLink')
-rw-r--r--rt/share/html/Articles/Elements/ShowTopicLink27
1 files changed, 27 insertions, 0 deletions
diff --git a/rt/share/html/Articles/Elements/ShowTopicLink b/rt/share/html/Articles/Elements/ShowTopicLink
new file mode 100644
index 000000000..7b6d550be
--- /dev/null
+++ b/rt/share/html/Articles/Elements/ShowTopicLink
@@ -0,0 +1,27 @@
+<%args>
+$Topic
+$Class => 0
+</%args>
+% if ($Link) {
+<a href="Topics.html?id=<% $Topic->Id %>&class=<% $Class %>">\
+% }
+<% $Topic->Name() || loc("(no name)") %>\
+% if ($Topic->Description) {
+: <% $Topic->Description %>
+% }
+
+% if ( $Articles->Count ) {
+ (<&|/l, $Articles->Count &>[quant,_1,article]</&>)
+% }
+
+% if ($Link) {
+</a>
+% }
+
+<%init>
+my $Articles = RT::ObjectTopics->new( $session{'CurrentUser'} );
+$Articles->Limit( FIELD => 'ObjectType', VALUE => 'RT::Article' );
+$Articles->Limit( FIELD => 'Topic', VALUE => $Topic->Id );
+
+my $Link = $Topic->Children->Count || $Articles->Count;
+</%init>