summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/InlineHistory/Extension.pm19
-rw-r--r--extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl10
2 files changed, 26 insertions, 3 deletions
diff --git a/extensions/InlineHistory/Extension.pm b/extensions/InlineHistory/Extension.pm
index 803262517..4cff558c7 100644
--- a/extensions/InlineHistory/Extension.pm
+++ b/extensions/InlineHistory/Extension.pm
@@ -12,6 +12,7 @@ use base qw(Bugzilla::Extension);
use Bugzilla::User::Setting;
use Bugzilla::Constants;
use Bugzilla::Attachment;
+use Bugzilla::Util 'correct_urlbase';
our $VERSION = '1.5';
@@ -124,6 +125,24 @@ sub template_before_process {
}
}
+ # split see-also
+ if ($change->{fieldname} eq 'see_also') {
+ my $url_base = correct_urlbase();
+ foreach my $f (qw( added removed )) {
+ my @values;
+ foreach my $value (split(/, /, $change->{$f})) {
+ my ($bug_id) = substr($value, 0, length($url_base)) eq $url_base
+ ? $value =~ /id=(\d+)$/
+ : undef;
+ push @values, {
+ url => $value,
+ bug_id => $bug_id,
+ };
+ }
+ $change->{$f} = \@values;
+ }
+ }
+
# split multiple flag changes (must be processed last)
if ($change->{fieldname} eq 'flagtypes.name') {
my @added = split(/, /, $change->{added});
diff --git a/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl b/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl
index 3c4d4a202..d75c69f78 100644
--- a/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl
+++ b/extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl
@@ -142,9 +142,13 @@
UNLESS is_safe_url(value) %]>
[%~%][% value FILTER ih_short_value FILTER html FILTER js %]</a>
[% ELSIF change.fieldname == 'see_also' %]
- [% FOREACH see_also = value.split(', ') %]
- [%~%]<a href="[% see_also FILTER html FILTER js %]" target="_blank">
- [%~%][% see_also FILTER html FILTER js %]</a>
+ [% FOREACH see_also = value %]
+ [% IF see_also.bug_id %]
+ [%~%][% "$terms.bug $see_also.bug_id" FILTER bug_link(see_also.bug_id) FILTER js %]
+ [% ELSE %]
+ [%~%]<a href="[% see_also.url FILTER html FILTER js %]" target="_blank">
+ [%~%][% see_also.url FILTER html FILTER js %]</a>
+ [% END %]
[%- ", " IF NOT loop.last %]
[% END %]
[% ELSIF change.fieldname == 'assigned_to' ||