From: burnus%gmx.de <> Date: Wed, 9 Apr 2003 16:29:15 +0000 (+0000) Subject: Bug 71790 - Duplicate resolution field should include bug number of original X-Git-Tag: bugzilla-2.17.4~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbb41a57d19d5e395e92c42d9852357f56e76635;p=thirdparty%2Fbugzilla.git Bug 71790 - Duplicate resolution field should include bug number of original r=bbaetz,a=justdave --- diff --git a/Bug.pm b/Bug.pm index b451190e2a..9e8e44c55b 100755 --- a/Bug.pm +++ b/Bug.pm @@ -262,6 +262,24 @@ sub initBug { return $self; } +sub dup_id { + my ($self) = @_; + + return $self->{'dup_id'} if exists $self->{'dup_id'}; + + $self->{'dup_id'} = undef; + if ($self->{'resolution'} eq 'DUPLICATE') { + my $dbh = Bugzilla->dbh; + $self->{'dup_id'} = + $dbh->selectrow_array(q{SELECT dupe_of + FROM duplicates + WHERE dupe = ?}, + undef, + $self->{'bug_id'}); + } + return $self->{'dup_id'}; +} + sub actual_time { my ($self) = @_; diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index b451190e2a..9e8e44c55b 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -262,6 +262,24 @@ sub initBug { return $self; } +sub dup_id { + my ($self) = @_; + + return $self->{'dup_id'} if exists $self->{'dup_id'}; + + $self->{'dup_id'} = undef; + if ($self->{'resolution'} eq 'DUPLICATE') { + my $dbh = Bugzilla->dbh; + $self->{'dup_id'} = + $dbh->selectrow_array(q{SELECT dupe_of + FROM duplicates + WHERE dupe = ?}, + undef, + $self->{'bug_id'}); + } + return $self->{'dup_id'}; +} + sub actual_time { my ($self) = @_; diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 463247c86d..e596af2269 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -217,7 +217,7 @@ sub create { my ($context, $bug) = @_; return sub { my $text = shift; - return &::GetBugLink($text, $bug); + return &::GetBugLink($bug, $text); }; }, 1 diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 2d93062560..6d512e1fd8 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -160,7 +160,12 @@ Resolution: - [% bug.resolution FILTER html %] + + [% bug.resolution FILTER html %] + [% IF bug.resolution == "DUPLICATE" %] + of [% "bug ${bug.dup_id}" FILTER bug_link(bug.dup_id) %] + [% END %] +