diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-05-12 23:27:10 -0700 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-05-12 23:27:10 -0700 |
commit | 72d9f52a212e557110622b37e81027458ceb3ecb (patch) | |
tree | 8a326d2153e9e13bfdc336f27a8cf9b3ee01d5dc | |
parent | 4971fab0bfc106afaad860bfa3e3e6cb0eb47f26 (diff) | |
download | bugs-72d9f52a212e557110622b37e81027458ceb3ecb.tar bugs-72d9f52a212e557110622b37e81027458ceb3ecb.tar.gz bugs-72d9f52a212e557110622b37e81027458ceb3ecb.tar.bz2 bugs-72d9f52a212e557110622b37e81027458ceb3ecb.tar.xz bugs-72d9f52a212e557110622b37e81027458ceb3ecb.zip |
Bug 556105: process_bug.cgi: Change the setting of normal global bug fields
to use set_all
r=dkl, a=mkanat
-rwxr-xr-x | process_bug.cgi | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 51664e3c5..f41dc761d 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -325,14 +325,23 @@ my @set_fields = qw(op_sys rep_platform priority bug_severity deadline remaining_time estimated_time); push(@set_fields, 'assigned_to') if !$cgi->param('set_default_assignee'); push(@set_fields, 'qa_contact') if !$cgi->param('set_default_qa_contact'); +my %field_translation = ( + bug_severity => 'severity', + rep_platform => 'platform', + short_desc => 'summary', + bug_file_loc => 'url', +); + +my %set_all_fields; +foreach my $field_name (@set_fields) { + if (should_set($field_name)) { + my $param_name = $field_translation{$field_name} || $field_name; + $set_all_fields{$param_name} = $cgi->param($field_name); + } +} + my @custom_fields = Bugzilla->active_custom_fields; -my %methods = ( - bug_severity => 'set_severity', - rep_platform => 'set_platform', - short_desc => 'set_summary', - bug_file_loc => 'set_url', -); foreach my $b (@bug_objects) { if (should_set('comment') || $cgi->param('work_time')) { # Add a comment as needed to each bug. This is done early because @@ -341,13 +350,7 @@ foreach my $b (@bug_objects) { { isprivate => scalar $cgi->param('commentprivacy'), work_time => scalar $cgi->param('work_time') }); } - foreach my $field_name (@set_fields) { - if (should_set($field_name)) { - my $method = $methods{$field_name}; - $method ||= "set_" . $field_name; - $b->$method($cgi->param($field_name)); - } - } + $b->set_all(\%set_all_fields); $b->reset_assigned_to if $cgi->param('set_default_assignee'); $b->reset_qa_contact if $cgi->param('set_default_qa_contact'); |