X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FShowRelationLabel;h=3447f08d5917df4a5c4613f5d6af03b90f318ae3;hb=HEAD;hp=9e6ea97a35697328cef85b8c452f53a849b8c655;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916;p=freeside.git diff --git a/rt/share/html/Elements/ShowRelationLabel b/rt/share/html/Elements/ShowRelationLabel index 9e6ea97a3..3447f08d5 100644 --- a/rt/share/html/Elements/ShowRelationLabel +++ b/rt/share/html/Elements/ShowRelationLabel @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2019 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