Bug 40933 - Enable default UNCONFIRMED

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@897 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2010-08-02 10:40:04 +00:00
parent 1a396e1105
commit 75e17f4d75
5 changed files with 37 additions and 5 deletions

View File

@ -650,6 +650,17 @@ sub get_fields {
return @$fields;
}
sub field
{
my $class = shift;
my $name = shift;
if (!exists $class->request_cache->{"field_$name"})
{
$class->request_cache->{"field_$name"} = Bugzilla::Field->new({ name => $name });
}
return $class->request_cache->{"field_$name"};
}
sub active_custom_fields {
my $class = shift;
if (!exists $class->request_cache->{active_custom_fields}) {

View File

@ -102,6 +102,7 @@ use constant DB_COLUMNS => qw(
buglist
visibility_field_id
value_field_id
enabled
);
use constant REQUIRED_CREATE_FIELDS => qw(name description);
@ -115,6 +116,7 @@ use constant VALIDATORS => {
obsolete => \&_check_obsolete,
sortkey => \&_check_sortkey,
type => \&_check_type,
enabled => \&Bugzilla::Object::check_boolean,
visibility_field_id => \&_check_visibility_field_id,
};
@ -131,7 +133,7 @@ use constant UPDATE_COLUMNS => qw(
buglist
visibility_field_id
value_field_id
enabled
type
);
@ -431,6 +433,19 @@ sub obsolete { return $_[0]->{obsolete} }
=over
=item C<enabled>
a true value tells Bugzilla not to display and not to use this field in any operations,
though it could be present in the database.
=back
=cut
sub enabled { return $_[0]->{enabled} }
=over
=item C<enter_bug>
A boolean specifying whether or not this field should appear on

View File

@ -596,12 +596,9 @@ $vars->{resolution} = [ grep ($_, @{get_legal_field_values('resolution')}) ];
if (formvalue('bug_status') && (lsearch(\@status, formvalue('bug_status')) >= 0)) {
$default{'bug_status'} = formvalue('bug_status');
} elsif (scalar @status == 1) {
} else {
$default{'bug_status'} = $status[0];
}
else {
$default{'bug_status'} = ($status[0] ne 'UNCONFIRMED') ? $status[0] : $status[1];
}
my $grouplist = $dbh->selectall_arrayref(
q{SELECT DISTINCT groups.id, groups.name, groups.description,

View File

@ -90,3 +90,6 @@ $schema->{globalauth} = {
globalauth_primary_idx => { FIELDS => ['id'], TYPE => 'UNIQUE' },
],
};
# Bug 55655 - Возможность смены типа или отключения стандартного поля "Приоритет"
push @{$schema->{fielddefs}->{FIELDS}}, enabled => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 1 };

View File

@ -166,3 +166,9 @@ if (!$dbh->bz_column_info('logincookies', 'session_data'))
{
$dbh->bz_add_column('logincookies', session_data => {TYPE => 'blob'});
}
# Bug 55655 - Возможность смены типа или отключения стандартного поля "Приоритет"
if (!$dbh->bz_column_info('fielddefs', 'enabled'))
{
$dbh->bz_add_column('fielddefs', enabled => { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 1 });
}