diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-01 17:34:26 -0800 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-01 17:34:26 -0800 |
commit | b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af (patch) | |
tree | c08cb54facdfa7f21833b6519fd0f468f5022e29 /Bugzilla/Field.pm | |
parent | 52ca02ea108a6c1d4c1ec735d3907782c2000586 (diff) | |
download | bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar.gz bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar.bz2 bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.tar.xz bugs-b0642d67ae6a9a7e7bbb8b8dc7a832c26bb211af.zip |
Bug 487508: Allow restricting the visibility of custom fields and values by component
r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla/Field.pm')
-rw-r--r-- | Bugzilla/Field.pm | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm index 7b1569c52..2f14037ab 100644 --- a/Bugzilla/Field.pm +++ b/Bugzilla/Field.pm @@ -180,7 +180,7 @@ use constant DEFAULT_FIELDS => ( {name => 'priority', desc => 'Priority', in_new_bugmail => 1, type => FIELD_TYPE_SINGLE_SELECT, buglist => 1}, {name => 'component', desc => 'Component', in_new_bugmail => 1, - buglist => 1}, + type => FIELD_TYPE_SINGLE_SELECT, buglist => 1}, {name => 'assigned_to', desc => 'AssignedTo', in_new_bugmail => 1, buglist => 1}, {name => 'reporter', desc => 'ReportedBy', in_new_bugmail => 1, @@ -492,6 +492,28 @@ sub is_select { || $_[0]->type == FIELD_TYPE_MULTI_SELECT) ? 1 : 0 } +=over + +=item C<is_abnormal> + +Most fields that have a C<SELECT> L</type> have a certain schema for +the table that stores their values, the table has the same name as the field, +and the field's legal values can be edited via F<editvalues.cgi>. + +However, some fields do not follow that pattern. Those fields are +considered "abnormal". + +This method returns C<1> if the field is "abnormal", C<0> otherwise. + +=back + +=cut + +sub is_abnormal { + my $self = shift; + return grep($_ eq $self->name, ABNORMAL_SELECTS) ? 1 : 0; +} + sub legal_values { my $self = shift; |