From 736922eee281894fd916d313e9ea4e0cccecd1af Mon Sep 17 00:00:00 2001 From: "burnus%gmx.de" Date: Wed, 9 Apr 2003 09:29:19 +0000 Subject: [PATCH] Bug 71790 - Duplicate resolution field should include bug number of original r=bbaetz,a=justdave git-svn-id: svn://10.0.0.236/trunk@140906 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bug.pm | 18 ++++++++++++++++++ mozilla/webtools/bugzilla/Bugzilla/Bug.pm | 18 ++++++++++++++++++ mozilla/webtools/bugzilla/Bugzilla/Template.pm | 2 +- .../template/en/default/bug/edit.html.tmpl | 7 ++++++- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/bugzilla/Bug.pm b/mozilla/webtools/bugzilla/Bug.pm index b451190e2a4..9e8e44c55bf 100755 --- a/mozilla/webtools/bugzilla/Bug.pm +++ b/mozilla/webtools/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/mozilla/webtools/bugzilla/Bugzilla/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm index b451190e2a4..9e8e44c55bf 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm +++ b/mozilla/webtools/bugzilla/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/mozilla/webtools/bugzilla/Bugzilla/Template.pm b/mozilla/webtools/bugzilla/Bugzilla/Template.pm index 463247c86de..e596af2269f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template.pm +++ b/mozilla/webtools/bugzilla/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/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl index 2d930625605..6d512e1fd82 100644 --- a/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl +++ b/mozilla/webtools/bugzilla/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 %] +