aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/BugUrl/Bugzilla.pm5
-rw-r--r--template/en/default/bug/field.html.tmpl17
2 files changed, 18 insertions, 4 deletions
diff --git a/Bugzilla/BugUrl/Bugzilla.pm b/Bugzilla/BugUrl/Bugzilla.pm
index f8e714d9d..53f174556 100644
--- a/Bugzilla/BugUrl/Bugzilla.pm
+++ b/Bugzilla/BugUrl/Bugzilla.pm
@@ -59,4 +59,9 @@ sub _check_value {
return $uri;
}
+sub target_bug_id {
+ my ($self) = @_;
+ return new URI($self->name)->query_param('id');
+}
+
1;
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index 900a78271..323b4b6be 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -165,8 +165,7 @@
[% '<ul class="bug_urls">' IF value.size %]
[% FOREACH bug_url = value %]
<li>
- <a href="[% bug_url.name FILTER html %]">
- [% bug_url.name FILTER html %]</a>
+ [% PROCESS bug_url_link bug_url = bug_url %]
<label><input type="checkbox" value="[% bug_url.name FILTER html %]"
name="remove_[% field.name FILTER html %]">
Remove</label>
@@ -215,8 +214,9 @@
[% ELSIF field.type == constants.FIELD_TYPE_BUG_URLS %]
[% '<ul class="bug_urls">' IF value.size %]
[% FOREACH bug_url = value %]
- <li><a href="[% bug_url.name FILTER html %]">
- [% bug_url.name FILTER html %]</a></li>
+ <li>
+ [% PROCESS bug_url_link bug_url = bug_url %]
+ </li>
[% END %]
[% '</ul>' IF value.size %]
[% ELSE %]
@@ -237,3 +237,12 @@
[% ELSE %]
[% extra_field_item = '' %]
[% END %]
+
+[% BLOCK bug_url_link %]
+ [% IF bug_url.isa('Bugzilla::BugUrl::Bugzilla::Local') %]
+ [% bug_url.target_bug_id FILTER bug_link(bug_url.target_bug_id, use_alias => 1) FILTER none %]
+ [% ELSE %]
+ <a href="[% bug_url.name FILTER html %]">
+ [% bug_url.name FILTER html %]</a>
+ [% END %]
+[% END %]