diff options
author | mkanat%bugzilla.org <> | 2008-10-25 06:14:56 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2008-10-25 06:14:56 +0200 |
commit | a9822ceefb563a54420f13b2395b8c1359833778 (patch) | |
tree | b860dd7ab0cf156734d8eddd5d680bab587f4185 /editvalues.cgi | |
parent | 5323ab05caef4b7a5c44fb567b412a3917272f33 (diff) | |
download | bugzilla-a9822ceefb563a54420f13b2395b8c1359833778.tar.gz bugzilla-a9822ceefb563a54420f13b2395b8c1359833778.tar.xz |
Bug 458436: Allow standard global select fields to control visibility of custom fields
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bbaetz, a=mkanat
Diffstat (limited to 'editvalues.cgi')
-rwxr-xr-x | editvalues.cgi | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/editvalues.cgi b/editvalues.cgi index 85d4c9761..338245284 100755 --- a/editvalues.cgi +++ b/editvalues.cgi @@ -29,18 +29,6 @@ use Bugzilla::Token; use Bugzilla::Field; use Bugzilla::Field::Choice; -# List of different tables that contain the changeable field values -# (the old "enums.") Keep them in alphabetical order by their -# English name from field-descs.html.tmpl. -# Format: Array of valid field names. -my @valid_fields = ('op_sys', 'rep_platform', 'priority', 'bug_severity', - 'bug_status', 'resolution'); - -# Add custom select fields. -my @custom_fields = Bugzilla->get_fields( - {custom => 1, type => [FIELD_TYPE_SINGLE_SELECT, FIELD_TYPE_MULTI_SELECT]}); -push(@valid_fields, map { $_->name } @custom_fields); - ############### # Subroutines # ############### @@ -87,8 +75,7 @@ my $token = $cgi->param('token'); # field = '' -> Show nice list of fields # if (!$cgi->param('field')) { - # Convert @valid_fields into the format that select-field wants. - my @field_list = map({ name => $_ }, @valid_fields); + my @field_list = Bugzilla->get_fields({ is_select => 1 }); $vars->{'fields'} = \@field_list; $template->process("admin/fieldvalues/select-field.html.tmpl", $vars) @@ -98,7 +85,7 @@ if (!$cgi->param('field')) { # At this point, the field must be defined. my $field = Bugzilla::Field->check($cgi->param('field')); -if (!grep($_ eq $field->name, @valid_fields)) { +if (!$field->is_select) { ThrowUserError('fieldname_invalid', { field => $field }); } $vars->{'field'} = $field; |