summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-07-19 06:10:31 +0200
committermkanat%bugzilla.org <>2006-07-19 06:10:31 +0200
commitf27aaa287562fb880934565d6a091ab1674bfab4 (patch)
treeef713bebee235631f1435d0312a0494caed9c8c1 /Bugzilla
parentaa205508ed3bc52b02cde76286daaec40aebfa5c (diff)
downloadbugzilla-f27aaa287562fb880934565d6a091ab1674bfab4.tar.gz
bugzilla-f27aaa287562fb880934565d6a091ab1674bfab4.tar.xz
Bug 344521: Make custom fields optionally functional on enter_bug.cgi
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Schema.pm2
-rw-r--r--Bugzilla/Field.pm19
2 files changed, 20 insertions, 1 deletions
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<enter_bug>
+
+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(