summaryrefslogtreecommitdiff
path: root/rt/share/html/Elements/ShowRelationLabel
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-09 22:32:26 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 22:32:26 -0700
commit026dc7ad72ba972f230b6709e31fa64397d75ad4 (patch)
treec5af1a7ac9154744afc3660e9a9405892f2bb50b /rt/share/html/Elements/ShowRelationLabel
parent07b4bc84d1078f7390221d766cdb3142513db4b0 (diff)
parent1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (diff)
merge RT 4.2.11 and Header changes to disable RT javascript, RT#34237
Diffstat (limited to 'rt/share/html/Elements/ShowRelationLabel')
-rw-r--r--rt/share/html/Elements/ShowRelationLabel30
1 files changed, 24 insertions, 6 deletions
diff --git a/rt/share/html/Elements/ShowRelationLabel b/rt/share/html/Elements/ShowRelationLabel
index 92d8fec8d..e1c684f09 100644
--- a/rt/share/html/Elements/ShowRelationLabel
+++ b/rt/share/html/Elements/ShowRelationLabel
@@ -45,18 +45,36 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<a href="<%$SearchURL |n %>"><%$Label%></a>
+% if ($SearchURL) {
+<a href="<% $SearchURL %>"><% $Label %></a>
+% } else {
+<% $Label %>
+% }
<%INIT>
-my $typemap = RT::Ticket->LINKTYPEMAP->{$Relation};
+my $typemap = $RT::Link::TYPEMAP{$Relation};
my $search_mode = $typemap->{Mode};
my $search_type = $typemap->{Type};
-my $search_relation = RT::Ticket->LINKDIRMAP->{$search_type}{$search_mode};
+my $search_relation = $RT::Link::DIRMAP{$search_type}->{$search_mode};
+my $SearchURL;
-my $Query = $search_relation . ' = ' . $id;
-my $SearchURL = RT->Config->Get('WebPath') . '/Search/Results.html?' . $m->comp('/Elements/QueryString', Query => $Query);
+if ($Object and $Object->id) {
+ my $id = $Object->id;
+
+ if ($Object->isa("RT::Ticket")) {
+ $SearchURL = RT->Config->Get('WebPath')
+ . '/Search/Results.html?'
+ . $m->comp('/Elements/QueryString', Query => "$search_relation = $id");
+ }
+}
+
+$m->callback(
+ CallbackName => "ModifySearchURL",
+ SearchURL => \$SearchURL,
+ ARGSRef => \%ARGS,
+);
</%INIT>
<%ARGS>
-$id
+$Object => undef
$Label
$Relation
</%ARGS>