Bug 40933
Backout -r 165:166 (restrictible custom fields) git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@264 6955db30-a419-402b-8a0d-67ecbb4d7f56master
parent
fb4c95ad44
commit
08c0941e00
|
@ -662,8 +662,6 @@ use constant ABSTRACT_SCHEMA => {
|
|||
sortkey => {TYPE => 'INT2', NOTNULL => 1},
|
||||
obsolete => {TYPE => 'BOOLEAN', NOTNULL => 1,
|
||||
DEFAULT => 'FALSE'},
|
||||
classificate=> {TYPE => 'BOOLEAN', NOTNULL => 1,
|
||||
DEFAULT => 'FALSE'},
|
||||
enter_bug => {TYPE => 'BOOLEAN', NOTNULL => 1,
|
||||
DEFAULT => 'FALSE'},
|
||||
buglist => {TYPE => 'BOOLEAN', NOTNULL => 1,
|
||||
|
|
|
@ -95,7 +95,6 @@ use constant DB_COLUMNS => qw(
|
|||
mailhead
|
||||
sortkey
|
||||
obsolete
|
||||
classificate
|
||||
enter_bug
|
||||
buglist
|
||||
visibility_field_id
|
||||
|
@ -112,7 +111,6 @@ use constant VALIDATORS => {
|
|||
buglist => \&Bugzilla::Object::check_boolean,
|
||||
mailhead => \&_check_mailhead,
|
||||
obsolete => \&_check_obsolete,
|
||||
classificate => \&_check_obsolete,
|
||||
sortkey => \&_check_sortkey,
|
||||
type => \&_check_type,
|
||||
visibility_field_id => \&_check_visibility_field_id,
|
||||
|
@ -128,7 +126,6 @@ use constant UPDATE_COLUMNS => qw(
|
|||
mailhead
|
||||
sortkey
|
||||
obsolete
|
||||
classificate
|
||||
enter_bug
|
||||
buglist
|
||||
visibility_field_id
|
||||
|
@ -449,18 +446,6 @@ sub obsolete { return $_[0]->{obsolete} }
|
|||
|
||||
=over
|
||||
|
||||
=item C<classificate>
|
||||
|
||||
a boolean specifying whether or not field's legal values must be restricted to the bug classification
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub classificate { return $_[0]->{classificate} }
|
||||
|
||||
=over
|
||||
|
||||
=item C<enter_bug>
|
||||
|
||||
A boolean specifying whether or not this field should appear on
|
||||
|
@ -666,7 +651,6 @@ They will throw an error if you try to set the values to something invalid.
|
|||
sub set_description { $_[0]->set('description', $_[1]); }
|
||||
sub set_enter_bug { $_[0]->set('enter_bug', $_[1]); }
|
||||
sub set_obsolete { $_[0]->set('obsolete', $_[1]); }
|
||||
sub set_classificate { $_[0]->set('classificate', $_[1]); }
|
||||
sub set_sortkey { $_[0]->set('sortkey', $_[1]); }
|
||||
sub set_in_new_bugmail { $_[0]->set('mailhead', $_[1]); }
|
||||
sub set_buglist { $_[0]->set('buglist', $_[1]); }
|
||||
|
@ -803,8 +787,6 @@ selectable as a display or order column in bug lists. Defaults to 0.
|
|||
|
||||
C<obsolete> - boolean - Whether this field is obsolete. Defaults to 0.
|
||||
|
||||
C<classificate> - boolean - Whether this field's legal values must be restricted to bug classification.
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
|
|
|
@ -64,7 +64,6 @@ elsif ($action eq 'new') {
|
|||
mailhead => scalar $cgi->param('new_bugmail'),
|
||||
enter_bug => scalar $cgi->param('enter_bug'),
|
||||
obsolete => scalar $cgi->param('obsolete'),
|
||||
classificate => scalar $cgi->param('classificate'),
|
||||
custom => 1,
|
||||
buglist => (scalar $cgi->param('type') == FIELD_TYPE_MULTI_SELECT ? 0 : 1),
|
||||
visibility_field_id => scalar $cgi->param('visibility_field_id'),
|
||||
|
@ -115,7 +114,6 @@ elsif ($action eq 'update') {
|
|||
$field->set_visibility_field($cgi->param('visibility_field_id'));
|
||||
$field->set_visibility_value($cgi->param('visibility_value_id'));
|
||||
$field->set_value_field($cgi->param('value_field_id'));
|
||||
$field->set_classificate($cgi->param('classificate'));
|
||||
$field->update();
|
||||
|
||||
delete_token($token);
|
||||
|
|
|
@ -141,9 +141,6 @@
|
|||
<tr>
|
||||
<th> </th>
|
||||
<td> </td>
|
||||
<th align="right"><label for="classificate">Restrict to classification:</label></th>
|
||||
<td><input type="checkbox" id="classificate" name="classificate" value="1"
|
||||
[%- " checked" IF field.classificate %]></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
|
|
@ -60,10 +60,6 @@
|
|||
name => "action"
|
||||
heading => "Action"
|
||||
content => ""
|
||||
},
|
||||
{
|
||||
name => "classificate"
|
||||
heading => "Restrict to classification"
|
||||
}
|
||||
]
|
||||
%]
|
||||
|
|
|
@ -1012,7 +1012,6 @@
|
|||
<tr>
|
||||
[% PROCESS bug/field.html.tmpl value=bug.${field.name}
|
||||
editable = bug.check_can_change_field(field.name, 0, 1)
|
||||
bug_object = bug
|
||||
value_span = 2 %]
|
||||
</tr>
|
||||
[% END %]
|
||||
|
|
|
@ -136,35 +136,23 @@
|
|||
[% ELSE %]
|
||||
[% legal_values = field.legal_values %]
|
||||
[% END %]
|
||||
[% IF field.classificate AND bug_object.classification %]
|
||||
[% SET classif_re = '\s+\(' _ bug_object.classification.replace('\W', '\\$1') _ '\)\s*$' %]
|
||||
[% FOREACH lv = legal_values %]
|
||||
[% legal_value = lv.value %]
|
||||
[% IF NOT legal_value.match('\)\s*$') OR legal_value.match(classif_re) %]
|
||||
<option value="[% legal_value FILTER html %]"
|
||||
[%- " selected=\"selected\"" IF value.contains(legal_value).size %]>
|
||||
[%- legal_value FILTER html %]</option>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% FOREACH legal_value = legal_values %]
|
||||
[% SET control_value = legal_value.visibility_value %]
|
||||
[% SET control_field = field.value_field %]
|
||||
<option value="[% legal_value.name FILTER html %]"
|
||||
id="v[% legal_value.id FILTER html %]_
|
||||
[%- field.name FILTER html %]"
|
||||
[%# We always show selected values, even if they should be
|
||||
# hidden %]
|
||||
[% IF value.contains(legal_value.name).size %]
|
||||
selected="selected"
|
||||
[% ELSIF (control_field && control_value
|
||||
&& !bug.${control_field.name}.contains(control_value.name))
|
||||
|| (field.name == "product" && legal_value.disallow_new)
|
||||
%]
|
||||
class="bz_hidden_option" disabled="disabled"
|
||||
[% END %]>
|
||||
[%- legal_value.name FILTER html %]</option>
|
||||
[% END %]
|
||||
[% FOREACH legal_value = legal_values %]
|
||||
[% SET control_value = legal_value.visibility_value %]
|
||||
[% SET control_field = field.value_field %]
|
||||
<option value="[% legal_value.name FILTER html %]"
|
||||
id="v[% legal_value.id FILTER html %]_
|
||||
[%- field.name FILTER html %]"
|
||||
[%# We always show selected values, even if they should be
|
||||
# hidden %]
|
||||
[% IF value.contains(legal_value.name).size %]
|
||||
selected="selected"
|
||||
[% ELSIF (control_field && control_value
|
||||
&& !bug.${control_field.name}.contains(control_value.name))
|
||||
|| (field.name == "product" && legal_value.disallow_new)
|
||||
%]
|
||||
class="bz_hidden_option" disabled="disabled"
|
||||
[% END %]>
|
||||
[%- legal_value.name FILTER html %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
[%# When you pass an empty multi-select in the web interface,
|
||||
|
|
Loading…
Reference in New Issue