Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 303669 Details for
Bug 406161
3.6: External Bug Tracker references
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to add external bug reference functionality (v3)
external_bugs.patch (text/plain), 47.65 KB, created by
David Lawrence
on 2008-04-24 18:21:30 UTC
(
hide
)
Description:
Patch to add external bug reference functionality (v3)
Filename:
MIME Type:
Creator:
David Lawrence
Created:
2008-04-24 18:21:30 UTC
Size:
47.65 KB
patch
obsolete
>? bugzilla-3.2rh-20080424.1.tar.gz >? bugzilla.spec >? localconfig >? patches >? test_external_bugs.pl >? data/params >Index: post_bug.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/post_bug.cgi,v >retrieving revision 1.9 >diff -u -r1.9 post_bug.cgi >--- post_bug.cgi 17 Mar 2008 21:48:07 -0000 1.9 >+++ post_bug.cgi 24 Apr 2008 17:11:47 -0000 >@@ -158,6 +158,13 @@ > estimated_time > deadline > )); >+ >+# REDHAT EXTENSION START 406161 >+# Allow extension to add additional fields >+Bugzilla::Hook::process('post_bug_fields', >+ { bug_fields => \@bug_fields }); >+# REDHAT EXTENSION END 406161 >+ > my %bug_params; > foreach my $field (@bug_fields) { > $bug_params{$field} = $cgi->param($field); >Index: process_bug.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/process_bug.cgi,v >retrieving revision 1.23 >diff -u -r1.23 process_bug.cgi >--- process_bug.cgi 11 Apr 2008 04:41:41 -0000 1.23 >+++ process_bug.cgi 24 Apr 2008 17:11:47 -0000 >@@ -574,6 +574,12 @@ > # Set and update flags. > Bugzilla::Flag->process($bug, undef, $timestamp, $vars); > >+ # REDHAT EXTENSION START 406161 >+ # Allow extensions to perform data updates >+ Bugzilla::Hook::process( 'update_bug_data', >+ { bug => $bug, timestamp => $timestamp } ); >+ # REDHAT EXTENSION END 406161 >+ > $dbh->bz_commit_transaction(); > > ############### >Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Bug.pm,v >retrieving revision 1.35 >diff -u -r1.35 Bug.pm >--- Bugzilla/Bug.pm 22 Apr 2008 23:59:58 -0000 1.35 >+++ Bugzilla/Bug.pm 24 Apr 2008 17:11:47 -0000 >@@ -276,6 +276,10 @@ > return $error_self; > } > >+ # REDHAT EXTENSION START 406161 >+ Bugzilla::Hook::process('get_bug_data', { bug => $self }); >+ # REDHAT EXTENSION END 406161 >+ > return $self; > } > >@@ -348,6 +352,14 @@ > delete $params->{comment}; > delete $params->{commentprivacy}; > >+ # REDHAT EXTENSION START 406161 >+ # Remove params that should not be used in insert_create_data >+ # but need to be passed to the create_bug_data hook >+ my $deleted_hook_params = {}; >+ Bugzilla::Hook::process('delete_insert_params', >+ { params => $params, deleted_params => $deleted_hook_params }); >+ # REDHAT EXTENSION END 406161 >+ > # Set up the keyword cache for bug creation. > my $keywords = $params->{keywords}; > $params->{keywords} = join(', ', sort {lc($a) cmp lc($b)} >@@ -466,6 +478,12 @@ > $dbh->do('INSERT INTO longdescs (' . join(',', @columns) . ") > VALUES ($qmarks)", undef, @values); > >+ # REDHAT EXTENSION START 406161 >+ # Allow extensions to create additional data on new bug creation >+ Bugzilla::Hook::process('create_bug_data', >+ { bug => $bug, params => $params, deleted_params => $deleted_hook_params }); >+ # REDHAT EXTENSION END 406161 >+ > $dbh->bz_commit_transaction(); > > # Because MySQL doesn't support transactions on the fulltext table, >@@ -1727,6 +1745,11 @@ > > sub fields { > my $class = shift; >+ my @extra_fields; >+ >+ # REDHAT EXTENSION START 406161 >+ Bugzilla::Hook::process('get_bug_fields', { fields => \@extra_fields }); >+ # REDHAT EXTENSION END 406161 > > return ( > # Standard Fields >@@ -1741,10 +1764,15 @@ > dependson blocked votes everconfirmed > reporter assigned_to cc estimated_time > remaining_time actual_time deadline), >+ >+ # REDHAT EXTENSION START 406161 >+ @extra_fields, >+ # REDHAT EXTENSION END 406161 >+ > # Conditional Fields > Bugzilla->params->{'useqacontact'} ? "qa_contact" : (), > # Custom Fields >- map { $_->name } Bugzilla->active_custom_fields >+ map { $_->name } Bugzilla->active_custom_fields, > ); > } > >Index: Bugzilla/BugMail.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/BugMail.pm,v >retrieving revision 1.13 >diff -u -r1.13 BugMail.pm >--- Bugzilla/BugMail.pm 2 Apr 2008 00:46:28 -0000 1.13 >+++ Bugzilla/BugMail.pm 24 Apr 2008 17:11:47 -0000 >@@ -416,7 +416,7 @@ > } > } > } >- >+ > if (Bugzilla->params->{"supportwatchers"}) { > # Find all those user-watching anyone on the current list, who is not > # on it already themselves. >@@ -644,6 +644,12 @@ > removed => $diff->{old}, visible => \$add_diff }); > # REDHAT EXTENSIONS END 406111 > >+ # REDHAT EXTENSIONS START 406161 >+ Bugzilla::Hook::process('filter_change', >+ { field => $diff->{fieldname}, added => $diff->{new}, >+ removed => $diff->{old}, visible => \$add_diff }); >+ # REDHAT EXTENSIONS END 406161 >+ > if ($add_diff) { > if (exists($diff->{'header'}) && > ($diffheader ne $diff->{'header'})) { >Index: Bugzilla/Search.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Search.pm,v >retrieving revision 1.24 >diff -u -r1.24 Search.pm >--- Bugzilla/Search.pm 17 Apr 2008 20:13:44 -0000 1.24 >+++ Bugzilla/Search.pm 24 Apr 2008 17:11:47 -0000 >@@ -513,6 +513,13 @@ > ",(changedfrom|changedto)" => \&_changedfrom_changedto, > ",changedby" => \&_changedby, > ); >+ >+ # REDHAT EXTENSION START 406161 >+ # Allow extension to add custom search functions >+ Bugzilla::Hook::process('search_functions', >+ { functions => \@funcdefs }); >+ # REDHAT EXTENSION END 406161 >+ > my @funcnames; > while (@funcdefs) { > my $key = shift(@funcdefs); >Index: Bugzilla/Template/Plugin/Hook.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Template/Plugin/Hook.pm,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 Hook.pm >--- Bugzilla/Template/Plugin/Hook.pm 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ Bugzilla/Template/Plugin/Hook.pm 24 Apr 2008 17:11:47 -0000 >@@ -49,6 +49,7 @@ > > my $paths = $self->{_CONTEXT}->{LOAD_TEMPLATES}->[0]->paths; > my $template = $self->{_CONTEXT}->stash->{component}->{name}; >+ my $caller = $self->{_CONTEXT}->stash->{component}->{caller}; > my @hooks = (); > > # sanity check: >@@ -56,6 +57,9 @@ > ThrowCodeError('template_invalid', { name => $template}); > } > >+ # If we are in a PROCESS block then get the caller name instead >+ $template = $template =~ m/(.*)\.(.*)\.tmpl/ ? $template : $caller; >+ > # also get extension hook files that live in extensions/: > # parse out the parts of the template name > my ($vol, $subpath, $filename) = File::Spec->splitpath($template); >Index: extensions/external_bugs/version.pl >=================================================================== >RCS file: extensions/external_bugs/version.pl >diff -N extensions/external_bugs/version.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/version.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,31 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Example WebService Plugin >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org> >+ >+# This script does some code to return a version number. However, >+# most plugins will probably just want to return a raw string. >+# To do that, the only contents of the file should be the string >+# on a single line, like: >+# >+# '1.2.3'; >+ >+use strict; >+no warnings qw(void); # Avoid "useless use of a constant in void context" >+use Bugzilla::Constants; >+BUGZILLA_VERSION; >Index: extensions/external_bugs/code/create_bug_data.pl >=================================================================== >RCS file: extensions/external_bugs/code/create_bug_data.pl >diff -N extensions/external_bugs/code/create_bug_data.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/create_bug_data.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,46 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+ >+my $bug = Bugzilla->hook_args->{bug}; >+my $params = Bugzilla->hook_args->{params}; >+my $deleted_params = Bugzilla->hook_args->{deleted_params}; >+ >+my $external_id = $deleted_params->{external_id} >+ || $params->{external_id}; >+my $external_bug_id = $deleted_params->{external_bug_id} >+ || $params->{external_bug_id}; >+ >+Bugzilla->logger->debug("Starting: $external_id, $external_bug_id"); >+ >+# Insert new reference >+if ( $external_id && $external_bug_id ) { >+ Bugzilla->logger->debug("Starting: external_bugs->add($external_id, $external_bug_id)"); >+ $bug->external_bugs->add( >+ external_id => $external_id, >+ external_bug_id => $external_bug_id, >+ is_new => 1 >+ ); >+} >+ >+1; >Index: extensions/external_bugs/code/delete_insert_params.pl >=================================================================== >RCS file: extensions/external_bugs/code/delete_insert_params.pl >diff -N extensions/external_bugs/code/delete_insert_params.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/delete_insert_params.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,41 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+ >+my $params = Bugzilla->hook_args->{params}; >+my $deleted_params = Bugzilla->hook_args->{deleted_params}; >+ >+$deleted_params->{external_id} = delete $params->{external_id}; >+$deleted_params->{external_bug_id} = delete $params->{external_bug_id}; >+ >+Bugzilla->logger->debug("Starting: delete_insert_params, " . >+ $deleted_params->{external_id} . ", " . >+ $deleted_params->{external_bug_id}); >+ >+foreach my $key ( keys %{$params} ) { >+ if ( $key =~ /^rem_ext_/ ) { >+ $deleted_params->{$key} = delete $params->{$key}; >+ } >+} >+ >+1; >Index: extensions/external_bugs/code/enter_bug-entrydefaultvars.pl >=================================================================== >RCS file: extensions/external_bugs/code/enter_bug-entrydefaultvars.pl >diff -N extensions/external_bugs/code/enter_bug-entrydefaultvars.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/enter_bug-entrydefaultvars.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,33 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+use extensions::external_bugs::lib::ExternalBugs; >+ >+my $vars = Bugzilla->hook_args->{vars}; >+ >+Bugzilla->logger->debug("Starting: enter_bug-entrydefaultvars"); >+ >+my $ext_bugs = extensions::external_bugs::lib::ExternalBugs->new(); >+$vars->{external_choices} = $ext_bugs->choices(); >+ >+1; >Index: extensions/external_bugs/code/get_bug_data.pl >=================================================================== >RCS file: extensions/external_bugs/code/get_bug_data.pl >diff -N extensions/external_bugs/code/get_bug_data.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/get_bug_data.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,32 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+use extensions::external_bugs::lib::ExternalBugs; >+ >+my $bugref = Bugzilla->hook_args->{bug}; >+ >+Bugzilla->logger->debug("Starting: get_bug_data"); >+ >+$bugref->{'external_bugs'} = extensions::external_bugs::lib::ExternalBugs->new( { bug => $bugref } ); >+ >+1; >Index: extensions/external_bugs/code/get_bug_fields.pl >=================================================================== >RCS file: extensions/external_bugs/code/get_bug_fields.pl >diff -N extensions/external_bugs/code/get_bug_fields.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/get_bug_fields.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,31 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+ >+my $fields = Bugzilla->hook_args->{fields}; >+ >+Bugzilla->logger->debug("Starting: get_bug_fields"); >+ >+push( @$fields, 'external_bugs' ); >+ >+1; >Index: extensions/external_bugs/code/post_bug_fields.pl >=================================================================== >RCS file: extensions/external_bugs/code/post_bug_fields.pl >diff -N extensions/external_bugs/code/post_bug_fields.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/post_bug_fields.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,31 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+ >+my $bug_fields = Bugzilla->hook_args->{bug_fields}; >+ >+Bugzilla->logger->debug("Starting: post_bug_fields"); >+ >+push( @$bug_fields, 'external_id', 'external_bug_id' ); >+ >+1; >Index: extensions/external_bugs/code/search_functions.pl >=================================================================== >RCS file: extensions/external_bugs/code/search_functions.pl >diff -N extensions/external_bugs/code/search_functions.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/search_functions.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,72 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+ >+my $functions = Bugzilla->hook_args->{functions}; >+ >+Bugzilla->logger->debug("Starting: search_functions"); >+ >+# Place these on the front >+unshift(@$functions, >+ "^external_bugzilla.url," => sub { >+ my $self = shift; >+ my %func_args = @_; >+ my ($chartid, $supptables, $f) = >+ @func_args{qw(chartid supptables f)}; >+ >+ my $ext_bz_bug_map = "ext_bz_bug_map_$$chartid"; >+ push(@$supptables, "LEFT JOIN ext_bz_bug_map AS $ext_bz_bug_map " . >+ "ON bugs.bug_id = $ext_bz_bug_map.bug_id"); >+ my $external_bugzilla = "external_bugzilla_$$chartid"; >+ push(@$supptables, "LEFT JOIN external_bugzilla AS $external_bugzilla " . >+ "ON $ext_bz_bug_map.ext_bz_id = $external_bugzilla.id "); >+ $$f = "$external_bugzilla.url"; >+ }, >+ "^external_bugzilla.description," => sub { >+ my $self = shift; >+ my %func_args = @_; >+ my ($chartid, $supptables, $f) = >+ @func_args{qw(chartid supptables f)}; >+ >+ my $ext_bz_bug_map = "ext_bz_bug_map_$$chartid"; >+ push(@$supptables, "LEFT JOIN ext_bz_bug_map AS $ext_bz_bug_map " . >+ "ON bugs.bug_id = $ext_bz_bug_map.bug_id"); >+ my $external_bugzilla = "external_bugzilla_$$chartid"; >+ push(@$supptables, "LEFT JOIN external_bugzilla AS $external_bugzilla " . >+ "ON $ext_bz_bug_map.ext_bz_id = $external_bugzilla.id "); >+ $$f = "$external_bugzilla.description"; >+ }, >+ "^ext_bz_bug_map.ext_bz_bug_id," => sub { >+ my $self = shift; >+ my %func_args = @_; >+ my ($chartid, $f, $supptables) = >+ @func_args{qw(chartid f supptables)}; >+ >+ my $table = "ext_bz_bug_map_" . $$chartid; >+ push(@$supptables, "LEFT JOIN ext_bz_bug_map AS $table " . >+ "ON $table.bug_id = bugs.bug_id "); >+ $$f = "$table.ext_bz_bug_id"; >+ } >+); >+ >+1; >Index: extensions/external_bugs/code/send_change.pl >=================================================================== >RCS file: extensions/external_bugs/code/send_change.pl >diff -N extensions/external_bugs/code/send_change.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/send_change.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,39 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+use extensions::external_bugs::lib::ExternalBugs; >+ >+my $bug = Bugzilla->hook_args->{bug}; >+my $diffs = Bugzilla->hook_args->{diffs}; >+my $start = Bugzilla->hook_args->{start}; >+my $end = Bugzilla->hook_args->{end}; >+my $changer = Bugzilla->hook_args->{changer}; >+my $sentlist = Bugzilla->hook_args->{sent}; >+my $excluded = Bugzilla->hook_args->{excluded}; >+ >+Bugzilla->logger->debug("Starting: send_change"); >+ >+#push @$sentlist, 'External Bug Id(s) ' . join( ',', @$sent ) if @$sent; >+#push @$excluded, 'External Bug Id(s) ' . join( ',', @$excl ) if @$excl; >+ >+1; >Index: extensions/external_bugs/code/update_bug_data.pl >=================================================================== >RCS file: extensions/external_bugs/code/update_bug_data.pl >diff -N extensions/external_bugs/code/update_bug_data.pl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/code/update_bug_data.pl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,66 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Everything Solved, Inc. >+# Portions created by Everything Solved, Inc. are Copyright (C) 2007 >+# Everything Solved, Inc. All Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+use warnings; >+use Bugzilla; >+use Data::Dumper; >+ >+my $bug = Bugzilla->hook_args->{bug}; >+my $timestamp = Bugzilla->hook_args->{timestamp}; >+ >+my $cgi = Bugzilla->cgi; >+my $privs; >+ >+my $external_id = $cgi->param('external_id'); >+my $external_bug_id = $cgi->param('external_bug_id'); >+ >+Bugzilla->logger->debug("Starting: $external_id, $external_bug_id"); >+ >+# Insert new reference >+if ( $external_id && $external_bug_id) { >+ $bug->check_can_change_field('external_bugs', 0, 1, \$privs) >+ || ThrowUserError('illegal_change', { field => 'external_bugs', privs => $privs }); >+ Bugzilla->logger->debug("Starting: external_bugs->add($external_id, $external_bug_id)"); >+ $bug->external_bugs->add( >+ external_id => $external_id, >+ external_bug_id => $external_bug_id, >+ is_new => 0, >+ timestamp => $timestamp, >+ ); >+} >+ >+# Remove any references selected >+my %cgi = $cgi->Vars; >+foreach my $key ( keys %cgi ) { >+ if ( $key =~ /^rem_ext_(\d+)_(\d+)$/ && $cgi->param($key) ) { >+ $bug->check_can_change_field('external_bugs', 0, 1, \$privs) >+ || ThrowUserError('illegal_change', { field => 'external_bugs', privs => $privs }); >+ my ($external_id, $external_bug_id) = ($1, $2); >+ Bugzilla->logger->debug("Starting: external_bugs->remove($external_id, $external_bug_id)"); >+ $bug->external_bugs->remove( >+ external_id => $external_id, >+ external_bug_id => $external_bug_id, >+ timestamp => $timestamp >+ ); >+ } >+} >+ >+1; >Index: extensions/external_bugs/lib/ExternalBugs.pm >=================================================================== >RCS file: extensions/external_bugs/lib/ExternalBugs.pm >diff -N extensions/external_bugs/lib/ExternalBugs.pm >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/lib/ExternalBugs.pm 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,287 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# The Initial Developer of the Original Code is Netscape Communications >+# Corporation. Portions created by Netscape are >+# Copyright (C) 1998 Netscape Communications Corporation. All >+# Rights Reserved. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+ >+package extensions::external_bugs::lib::ExternalBugs; >+ >+use Bugzilla::Bug; >+use Bugzilla::Util; >+use Bugzilla::Error; >+use extensions::external_bugs::lib::ExternalBugs::Tracker; >+ >+############################### >+#### Initialization #### >+############################### >+ >+sub new { >+ my $invocant = shift; >+ my $class = ref($invocant) || $invocant; >+ my $param = shift; >+ >+ my $self = { _bug_obj => $param->{bug} }; >+ >+ bless( $self, $class ); >+ >+ $self->_init() if $self->{_bug_obj}; >+ >+ return $self; >+} >+ >+sub _init { >+ my ($self) = @_; >+ >+ my $dbh = Bugzilla->dbh; >+ >+ if ( not ref( $self->{_bug_obj} ) and not $self->{_bug_obj}->id ) { >+ ThrowUserError('ext_invalid_bug_object'); >+ } >+ >+ # Load the current list of external bugs attached to this bug >+ my $sth = $dbh->prepare( >+ "SELECT external_bugzilla.id, >+ external_bugzilla.url, >+ external_bugzilla.full_url, >+ external_bugzilla.is_bz, >+ external_bugzilla.description, >+ ext_bz_bug_map.ext_bz_bug_id >+ FROM external_bugzilla, >+ ext_bz_bug_map >+ WHERE external_bugzilla.id = ext_bz_bug_map.ext_bz_id >+ AND ext_bz_bug_map.bug_id = ? >+ ORDER BY external_bugzilla.description" >+ ); >+ $sth->execute( $self->{_bug_obj}->id ); >+ >+ $self->{bugs} = []; >+ while ( my ( $id, $url, $full_url, $is_bz, $desc, $bug_id ) >+ = $sth->fetchrow_array() ) >+ { >+ my %data; >+ $data{id} = $id; >+ $data{url} = $url; >+ $data{full_url} = _perform_substs( $full_url, { id => $bug_id } ); >+ $data{is_bz} = $is_bz; >+ $data{description} = $desc; >+ $data{bug_id} = $bug_id; >+ >+ if ($is_bz) { >+ my $buginfo; >+ eval { >+ use XMLRPC::Lite; >+ my $rpc = new XMLRPC::Lite( proxy => "$url/xmlrpc.cgi" ); >+ $buginfo >+ = $rpc->call( 'bugzilla.getBugSimple', $bug_id )->result; >+ }; >+ if ( !$@ && ref($buginfo) ) { >+ $data{status} = $buginfo->{bug_status}; >+ $data{long_summary} = $buginfo->{short_desc}; >+ $data{short_summary} >+ = substr( $buginfo->{short_desc}, 0, 40 ); >+ } >+ } >+ push( @{ $self->{bugs} }, \%data ); >+ } >+ >+ return 1; >+} >+ >+############################### >+#### Accessors ###### >+############################### >+ >+sub bugs { return $_[0]->{bugs}; } >+ >+sub choices { >+ my ($self) = @_; >+ >+ return $self->{choices} if $self->{choices}; >+ >+ $self->{choices} >+ = extensions::external_bugs::lib::ExternalBugs::Tracker->match(); >+ >+ return $self->{choices}; >+} >+ >+############################### >+#### Subroutines ###### >+############################### >+ >+sub add { >+ my ( $self, %params ) = @_; >+ my $external_id = $params{external_id}; >+ my $external_bug_id = $params{external_bug_id}; >+ my $timestamp = $params{timestamp}; >+ my $is_new = $params{is_new} || 0; >+ >+ my $dbh = Bugzilla->dbh; >+ my $tracker = extensions::external_bugs::lib::ExternalBugs::Tracker->new( >+ $external_id); >+ >+ Bugzilla->logger->debug("Adding $external_bug_id to " . $tracker->description); >+ >+ if ( $tracker >+ && $self->_validate_external_bug_id( $external_id, $external_bug_id ) >+ ) >+ { >+ >+ detaint_natural($external_id); >+ detaint_natural($external_bug_id); >+ >+ # Check for duplicates >+ my $exists = $dbh->selectrow_array( >+ "SELECT 1 FROM ext_bz_bug_map WHERE bug_id = ? AND ext_bz_id = ? AND ext_bz_bug_id = ?", >+ undef, $self->{_bug_obj}->id, $external_id, $external_bug_id >+ ); >+ >+ if ( !$exists ) { >+ $dbh->do( >+ "INSERT INTO ext_bz_bug_map (bug_id, ext_bz_id, ext_bz_bug_id) " >+ . "VALUES (?, ?, ?)", >+ undef, >+ $self->{_bug_obj}->id, >+ $external_id, >+ $external_bug_id >+ ); >+ >+ if ( !$is_new ) { >+ if ( !$timestamp ) { >+ $timestamp = $dbh->selectrow_array(q{SELECT NOW()}); >+ } >+ >+ LogActivityEntry( >+ $self->{_bug_obj}->id, >+ "ext_bz_bug_map.ext_bz_bug_id", >+ "", >+ $tracker->description . " $external_bug_id", >+ Bugzilla->user->id, >+ $timestamp >+ ); >+ } >+ >+ # Reload the bug data. >+ $self->_init(); >+ } >+ } >+} >+ >+sub remove { >+ my ( $self, %params ) = @_; >+ my $external_id = $params{external_id}; >+ my $external_bug_id = $params{external_bug_id}; >+ my $timestamp = $params{timestamp}; >+ >+ my $dbh = Bugzilla->dbh; >+ >+ my $tracker = extensions::external_bugs::lib::ExternalBugs::Tracker->new( >+ $external_id); >+ >+ Bugzilla->logger->debug("Removing $external_bug_id from " . $tracker->description); >+ >+ if ($tracker) { >+ >+ detaint_natural($external_id); >+ detaint_natural($external_bug_id); >+ >+ $dbh->do( >+ "DELETE FROM ext_bz_bug_map WHERE bug_id = ? AND ext_bz_id = ? AND ext_bz_bug_id = ?", >+ undef, $self->{_bug_obj}->id, $external_id, $external_bug_id >+ ); >+ >+ if ( !$timestamp ) { >+ $timestamp = $dbh->selectrow_array(q{SELECT NOW()}); >+ } >+ >+ LogActivityEntry( >+ $self->{_bug_obj}->id, >+ "ext_bz_bug_map.ext_bz_bug_id", >+ $tracker->description . " $external_bug_id", >+ "", >+ Bugzilla->user->id, >+ $timestamp >+ ); >+ >+ # Reload the bug data. >+ $self->_init(); >+ } >+} >+ >+sub _validate_external_bug_id { >+ my ( $self, $external_id, $external_bug_id ) = @_; >+ >+ # We currently cannot validate the actual bug ids at the external source >+ # but if we could it would go here. >+ detaint_natural($external_bug_id) >+ || ThrowUserError( 'ext_invalid_external_bug_id', >+ { badvalue => $external_bug_id } ); >+ >+ return $external_bug_id; >+} >+ >+sub _perform_substs { >+ my ( $str, $substs ) = (@_); >+ $str >+ =~ s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg; >+ return $str; >+} >+ >+1; >+ >+__END__ >+ >+=head1 NAME >+ >+extensions::external_bugs::lib::ExternalBugs - External Bugs Class. >+ >+=head1 SYNOPSIS >+ >+ use extensions::external_bugs::lib::ExternalBugs; >+ >+ my $external_bugs = extensions::external_bugs::lib::ExternalBugs::Tracker->new({bug => $bug_obj}); >+ >+ # Public methods >+ $external_bugs->add($external_id, $external_bug_id); >+ $external_bugs->remove($external_id, $external_bug_id); >+ >+ # Private methods >+ $self->_validate_external_bug_id($external_id, $external_bug_id); >+ $self->_perform_substs($tracker->full_url, $bug_id); >+ >+=head1 DESCRIPTION >+ >+Tracker represents a bug tracker object. It is an implementation >+of L<Bugzilla::Object>, and thus provides all methods that >+L<Bugzilla::Object> provides. >+ >+The methods that are specific to C<ExternalBugs::Tracker> are listed >+below. >+ >+=head1 METHODS >+ >+=over >+ >+=back >+ >+=head1 SEE ALSO >+ >+L<Bugzilla::Object> >+ >+=cut >Index: extensions/external_bugs/lib/ExternalBugs/Tracker.pm >=================================================================== >RCS file: extensions/external_bugs/lib/ExternalBugs/Tracker.pm >diff -N extensions/external_bugs/lib/ExternalBugs/Tracker.pm >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/lib/ExternalBugs/Tracker.pm 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,126 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# Contributor(s): Dave Lawrence <dkl@redhat.com> >+ >+use strict; >+ >+package extensions::external_bugs::lib::ExternalBugs::Tracker; >+ >+use base qw(Bugzilla::Object); >+ >+############################### >+#### Initialization #### >+############################### >+ >+use constant DB_TABLE => 'external_bugzilla'; >+ >+use constant DB_COLUMNS => qw( >+ external_bugzilla.id >+ external_bugzilla.url >+ external_bugzilla.description >+ external_bugzilla.full_url >+ external_bugzilla.is_bz >+); >+ >+use constant LIST_ORDER => 'external_bugzilla.description'; >+ >+use constant ID_FIELD => 'external_bugzilla.id'; >+ >+############################### >+#### Methods ##### >+############################### >+ >+sub bug_count { >+ my $self = shift; >+ my $dbh = Bugzilla->dbh; >+ >+ if (!defined $self->{'bug_count'}) { >+ $self->{'bug_count'} = $dbh->selectrow_array(qq{ >+ SELECT COUNT(bug_id) FROM ext_bz_bug_map >+ WHERE ext_bz_id = ?}, undef, $self->id); >+ >+ } >+ return $self->{'bug_count'}; >+} >+ >+sub bug_ids { >+ my $self = shift; >+ my $dbh = Bugzilla->dbh; >+ >+ if (!defined $self->{'bug_ids'}) { >+ $self->{'bug_ids'} = >+ $dbh->selectcol_arrayref(q{SELECT bug_id FROM ext_bz_bug_map >+ WHERE ext_bz_id = ?}, >+ undef, $self->id); >+ } >+ return $self->{'bug_ids'}; >+} >+ >+############################### >+#### Accessors ###### >+############################### >+ >+sub id { return $_[0]->{'id'}; } >+sub description { return $_[0]->{'description'}; } >+sub url { return $_[0]->{'url'}; } >+sub full_url { return $_[0]->{'full_url'}; } >+sub is_bz { return $_[0]->{'is_bz'}; } >+ >+############################### >+#### Subroutines ###### >+############################### >+ >+ >+1; >+ >+__END__ >+ >+=head1 NAME >+ >+extensions::external_bugs::lib::ExternalBugs::Tracker - External Bug Tracker class. >+ >+=head1 SYNOPSIS >+ >+ use extensions::external_bugs::lib::ExternalBugs::Tracker; >+ >+ my $tracker = extensions::external_bugs::lib::ExternalBugs::Tracker->new(1); >+ my $tracker = extensions::external_bugs::lib::ExternalBugs::Tracker->new({ name => 'AcmeProduct' }); >+ >+ my $id = $tracker->id; >+ my $url = $tracker->url; >+ my $description = $tracker->description; >+ my $full_url = $tracker->full_url; >+ my $is_bz = $tracker->is_bz; >+ >+=head1 DESCRIPTION >+ >+Tracker represents a bug tracker object. It is an implementation >+of L<Bugzilla::Object>, and thus provides all methods that >+L<Bugzilla::Object> provides. >+ >+The methods that are specific to C<ExternalBugs::Tracker> are listed >+below. >+ >+=head1 METHODS >+ >+=over >+ >+=back >+ >+=head1 SEE ALSO >+ >+L<Bugzilla::Object> >+ >+=cut >Index: extensions/external_bugs/template/en/bug/edit-table-data.html.tmpl >=================================================================== >RCS file: extensions/external_bugs/template/en/bug/edit-table-data.html.tmpl >diff -N extensions/external_bugs/template/en/bug/edit-table-data.html.tmpl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/template/en/bug/edit-table-data.html.tmpl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,69 @@ >+[%# The contents of this file are subject to the Mozilla Public >+ # License Version 1.1 (the "License"); you may not use this file >+ # except in compliance with the License. You may obtain a copy of >+ # the License at http://www.mozilla.org/MPL/ >+ # >+ # Software distributed under the License is distributed on an "AS >+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+ # implied. See the License for the specific language governing >+ # rights and limitations under the License. >+ # >+ # The Original Code is the Bugzilla Bug Tracking System. >+ # >+ # The Initial Developer of the Original Code is Netscape Communications >+ # Corporation. Portions created by Netscape are >+ # Copyright (C) 1998 Netscape Communications Corporation. All >+ # Rights Reserved. >+ # >+ # Contributor(s): Dave Lawrence <dkl@redhat.com> >+ #%] >+ >+<br> >+<table id="attachment_table" cellspacing="0" cellpadding="4"> >+ <tr> >+ <th colspan="[% bug.check_can_change_field('external_bugs', 0, 1) ? "5" : "4" %]" align="left"> >+ <a name="a0" id="a0">External [% terms.Bugs %]</a> >+ </th> >+ </tr> >+ >+ [% FOREACH extbz = bug.external_bugs.bugs %] >+ <tr> >+ <td valign="top"> >+ [% extbz.description FILTER html %] >+ </td> >+ <td valign="top"> >+ <a href="[% extbz.full_url %]">[% extbz.bug_id FILTER html %]</a> >+ </td> >+ <td valign="top"> >+ [% IF extbz.status %][% extbz.status FILTER html %][% ELSE %]No Status[% END %] >+ </td> >+ <td valign="top"> >+ [% IF extbz.short_summary %]<span title="[% extbz.long_summary FILTER html %]"> >+ [% extbz.short_summary FILTER html %]</span>[% ELSE %]No Description[% END %] >+ </td> >+ [% IF bug.check_can_change_field('external_bugs', 0, 1) %] >+ <td valign="top"> >+ <input type="checkbox" >+ name="rem_ext_[% extbz.id FILTER html %]_[% extbz.bug_id FILTER html %]" value="1"/> >+ Remove? >+ </td> >+ [% END %] >+ </tr> >+ [% END %] >+ >+ [% IF bug.check_can_change_field('external_bugs', 0, 1) %] >+ <tr class="bz_attach_footer"> >+ <td colspan="5"> >+ Add External [% terms.Bug %]: Location >+ <select name="external_id"> >+ <option value="0">-- Do not add --</option> >+ [% FOREACH extbz = bug.external_bugs.choices %] >+ <option value="[% extbz.id FILTER html %]" title="[% extbz.url FILTER html %]">[% extbz.description FILTER html %]</option> >+ [% END %] >+ </select> >+ [% terms.Bug %] ID <input id="inputbox" type="text" name="external_bug_id" size="10" maxsize="20"> >+ </td> >+ </tr> >+ [% END %] >+</table> >+<br> >Index: extensions/external_bugs/template/en/bug/create/create-form.html.tmpl >=================================================================== >RCS file: extensions/external_bugs/template/en/bug/create/create-form.html.tmpl >diff -N extensions/external_bugs/template/en/bug/create/create-form.html.tmpl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/template/en/bug/create/create-form.html.tmpl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,33 @@ >+[%# The contents of this file are subject to the Mozilla Public >+ # License Version 1.1 (the "License"); you may not use this file >+ # except in compliance with the License. You may obtain a copy of >+ # the License at http://www.mozilla.org/MPL/ >+ # >+ # Software distributed under the License is distributed on an "AS >+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+ # implied. See the License for the specific language governing >+ # rights and limitations under the License. >+ # >+ # The Original Code is the Bugzilla Bug Tracking System. >+ # >+ # The Initial Developer of the Original Code is Netscape Communications >+ # Corporation. Portions created by Netscape are >+ # Copyright (C) 1998 Netscape Communications Corporation. All >+ # Rights Reserved. >+ # >+ # Contributor(s): Dave Lawrence <dkl@redhat.com> >+ #%] >+ >+<tr> >+ <th>Add External [% terms.Bug %]:</th> >+ <td colspan="2"> >+ Location >+ <select name="external_id"> >+ <option value="0">-- Do not add --</option> >+ [% FOREACH e = external_choices %] >+ <option value="[% e.id FILTER html %]" title="[% e.url FILTER html %]">[% e.description FILTER html %]</option> >+ [% END %] >+ </select> >+ [% terms.Bug %] ID <input id="inputbox" type="text" name="external_bug_id" size="10" maxsize="20"> >+ </td> >+</tr> >Index: extensions/external_bugs/template/en/global/field-descs-end.none.tmpl >=================================================================== >RCS file: extensions/external_bugs/template/en/global/field-descs-end.none.tmpl >diff -N extensions/external_bugs/template/en/global/field-descs-end.none.tmpl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/template/en/global/field-descs-end.none.tmpl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,6 @@ >+[% field = "external_bugzilla.url" %] >+[% SET field_descs.${field} = "External $terms.Bug URL" %] >+[% field = "external_bugzilla.description" %] >+[% SET field_descs.${field} = "External $terms.Bug Description" %] >+[% field = "ext_bz_bug_map.ext_bz_bug_id" %] >+[% SET field_descs.${field} = "External $terms.Bug ID" %] >Index: extensions/external_bugs/template/en/global/user-error-errors.html.tmpl >=================================================================== >RCS file: extensions/external_bugs/template/en/global/user-error-errors.html.tmpl >diff -N extensions/external_bugs/template/en/global/user-error-errors.html.tmpl >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ extensions/external_bugs/template/en/global/user-error-errors.html.tmpl 24 Apr 2008 17:11:47 -0000 >@@ -0,0 +1,19 @@ >+[% IF error == "ext_invalid_bug_object" %] >+ [% title = "Invalid Bug Object" %] >+ An invalid bug object was passed in to an External >+ [% terms.Bug %] function. Please contact >+ <a href="mailto:[% Param('maintainter') %]"> >+ [% Param('maintainer') FILTER html %]</a> with >+ details of what you were doing when encountering >+ this error. >+[% ELSIF error == "ext_invalid_external_id" %] >+ [% title = "Invalid External Tracker ID" %] >+ An invalid value for an External [% terms.Bug %] >+ Tracker was submitted. Please choose a tracker >+ from the list of valid values. >+[% ELSIF error == "ext_invalid_external_bug_id" %] >+ [% title = "Invalid External Tracker ID" %] >+ An invalid value for an external [% terms.bug %] id >+ ([% badvalue FILTER html %]) was submitted. >+ [% terms.Bug %] values must be in positive integer format. >+[% END %] >Index: redhat/db_fixup.sql >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/redhat/db_fixup.sql,v >retrieving revision 1.8 >diff -u -r1.8 db_fixup.sql >--- redhat/db_fixup.sql 24 Apr 2008 07:16:08 -0000 1.8 >+++ redhat/db_fixup.sql 24 Apr 2008 17:11:47 -0000 >@@ -323,3 +323,7 @@ > --- Add javascript column to logincookies table -- > ALTER TABLE logincookies ADD COLUMN javascript BOOLEAN DEFAULT 0; > >+--- Update fielddefs definitions for External Bug Trackers >+UPDATE fielddefs SET name = 'external_bugzilla.url', description = 'External Bug URL' WHERE name = 'external_bugzilla_url'; >+UPDATE fielddefs SET name = 'external_bugzilla.description', description = 'External Bug Description' WHERE name = 'external_bugzilla_description'; >+UPDATE fielddefs SET name = 'ext_bz_bug_map.ext_bz_bug_id', description = 'External Bug ID' WHERE name = 'external_bugzilla_bug_id'; >Index: template/en/default/bug/edit.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/bug/edit.html.tmpl,v >retrieving revision 1.28 >diff -u -r1.28 edit.html.tmpl >--- template/en/default/bug/edit.html.tmpl 24 Apr 2008 16:27:49 -0000 1.28 >+++ template/en/default/bug/edit.html.tmpl 24 Apr 2008 17:11:47 -0000 >@@ -171,7 +171,7 @@ > [% PROCESS section_spacer %] > > [% PROCESS section_url_keyword_whiteboard %] >- >+ > [% PROCESS section_spacer %] > > [%# *** Dependencies *** %] >@@ -231,6 +231,11 @@ > show_attachment_flags = bug.show_attachment_flags > %] > >+[%# *** Additional Table Based Bug Data *** %] >+ >+ [%# REDHAT EXTENSION START 406161 %] >+ [% Hook.process('table-data') %] >+ [%# REDHAT EXTENSION END 406161 %] > > [%# *** Comments Groups *** %] > >Index: template/en/default/bug/show-multiple.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/bug/show-multiple.html.tmpl,v >retrieving revision 1.5 >diff -u -r1.5 show-multiple.html.tmpl >--- template/en/default/bug/show-multiple.html.tmpl 5 Mar 2008 21:41:51 -0000 1.5 >+++ template/en/default/bug/show-multiple.html.tmpl 24 Apr 2008 17:11:47 -0000 >@@ -176,6 +176,10 @@ > [% PROCESS row cell = "status_whiteboard" fullrow = 1 %] > [% END %] > >+ [%# REDHAT EXTENSION START 406161 %] >+ [% Hook.process('text-field') %] >+ [%# REDHAT EXTENSION END 406161 %] >+ > [% USE Bugzilla %] > [% field_counter = 0 %] > [% FOREACH field = Bugzilla.active_custom_fields %] >@@ -295,9 +299,12 @@ > [%###########################################################################%] > > [% BLOCK row %] >+ [%# REDHAT EXTENSION START 406161 %] >+ [% val = value ? value : bug.${cell} %] >+ [%# REDHAT EXTENSION END 406161 %] > <tr> > <th>[% field_descs.${cell} FILTER html %]:</th> >- <td[% " colspan=3" IF fullrow %]>[% bug.${cell} FILTER html %]</td> >+ <td[% " colspan=3" IF fullrow %]>[% val FILTER html %]</td> > [% PROCESS rightcell IF !fullrow %] > </tr> > [% fullrow = 0 %]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dkl
: review? (
kbaker
)
nelhawar
: review+
Actions:
View
|
Diff
Attachments on
bug 406161
:
302927
|
303205
| 303669