summaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2007-09-08 07:14:25 +0200
committermkanat%bugzilla.org <>2007-09-08 07:14:25 +0200
commitaa888f2218179d59b4f0b8e51e43b863f1da3e43 (patch)
tree4e6bf6ff4b7066b19c5b1728dd325adf4bed1f78 /query.cgi
parent16336299f17522d040736cb0f063694381d9d761 (diff)
downloadbugzilla-aa888f2218179d59b4f0b8e51e43b863f1da3e43.tar.gz
bugzilla-aa888f2218179d59b4f0b8e51e43b863f1da3e43.tar.xz
Bug 287330: Multi-Select Custom Fields
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi19
1 files changed, 15 insertions, 4 deletions
diff --git a/query.cgi b/query.cgi
index 3d18606ba..5ca04d81d 100755
--- a/query.cgi
+++ b/query.cgi
@@ -253,10 +253,21 @@ $vars->{'priority'} = get_legal_field_values('priority');
$vars->{'bug_severity'} = get_legal_field_values('bug_severity');
# Boolean charts
-my @fields;
-push(@fields, { name => "noop", description => "---" });
-push(@fields, $dbh->bz_get_field_defs());
-@fields = sort {lc($a->{'description'}) cmp lc($b->{'description'})} @fields;
+my @fields = Bugzilla->get_fields({ obsolete => 0 });
+# Multi-selects aren't searchable, currently.
+@fields = grep($_->type != FIELD_TYPE_MULTI_SELECT, @fields);
+
+# If we're not in the time-tracking group, exclude time-tracking fields.
+if (!Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) {
+ foreach my $tt_field (qw(estimated_time remaining_time work_time
+ percentage_complete deadline))
+ {
+ @fields = grep($_->name ne $tt_field, @fields);
+ }
+}
+
+@fields = sort {lc($a->description) cmp lc($b->description)} @fields;
+unshift(@fields, { name => "noop", description => "---" });
$vars->{'fields'} = \@fields;
# Creating new charts - if the cmd-add value is there, we define the field