diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:27:04 -0700 |
| commit | e131b1f71f08b69abb832c1687d1f29682d171f8 (patch) | |
| tree | 490167e41d9fe05b760e7b21a96ee35a86f8edda /rt/share/html/Elements/ShowRelationLabel | |
| parent | d05d7346bb2387fd9d0354923d577275c5c7f019 (diff) | |
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/share/html/Elements/ShowRelationLabel')
| -rw-r--r-- | rt/share/html/Elements/ShowRelationLabel | 30 |
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> |
