From f27aaa287562fb880934565d6a091ab1674bfab4 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 19 Jul 2006 04:10:31 +0000 Subject: Bug 344521: Make custom fields optionally functional on enter_bug.cgi Patch By Max Kanat-Alexander r=LpSolit, a=myk --- Bugzilla/DB/Schema.pm | 2 ++ Bugzilla/Field.pm | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index c885987bc..94e457dd0 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -464,6 +464,8 @@ use constant ABSTRACT_SCHEMA => { sortkey => {TYPE => 'INT2', NOTNULL => 1}, obsolete => {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'}, + enter_bug => {TYPE => 'BOOLEAN', NOTNULL => 1, + DEFAULT => 'FALSE'}, ], INDEXES => [ fielddefs_name_idx => {FIELDS => ['name'], diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm index 2118d41ac..e964141d4 100644 --- a/Bugzilla/Field.pm +++ b/Bugzilla/Field.pm @@ -82,7 +82,8 @@ use constant DB_COLUMNS => ( 'description', 'type', 'custom', - 'obsolete' + 'obsolete', + 'enter_bug', ); our $columns = join(", ", DB_COLUMNS); @@ -182,6 +183,19 @@ a boolean specifying whether or not the field is obsolete; sub obsolete { return $_[0]->{obsolete} } +=over + +=item C + +A boolean specifying whether or not this field should appear on +enter_bug.cgi + +=back + +=cut + +sub enter_bug { return $_[0]->{enter_bug} } + =pod @@ -267,6 +281,9 @@ sub match { if (defined $criteria->{obsolete}) { push(@terms, "obsolete=" . ($criteria->{obsolete} ? "1" : "0")); } + if (defined $criteria->{enter_bug}) { + push(@terms, "enter_bug=" . ($criteria->{enter_bug} ? '1' : '0')); + } my $where = (scalar(@terms) > 0) ? "WHERE " . join(" AND ", @terms) : ""; my $records = Bugzilla->dbh->selectall_arrayref( -- cgit v1.2.3-24-g4f1b