X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FShowRelationLabel;h=bd57cad0ff053ac788f93c62c47978c0a7154ecb;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=3b045e70391c1e21a1ffdec337c057202bf0c397;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/share/html/Elements/ShowRelationLabel b/rt/share/html/Elements/ShowRelationLabel index 3b045e703..bd57cad0f 100644 --- a/rt/share/html/Elements/ShowRelationLabel +++ b/rt/share/html/Elements/ShowRelationLabel @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,18 +45,36 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<%$Label%> +% if ($SearchURL) { +<% $Label %> +% } 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, +); <%ARGS> -$id +$Object => undef $Label $Relation