From aa888f2218179d59b4f0b8e51e43b863f1da3e43 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 8 Sep 2007 05:14:25 +0000 Subject: Bug 287330: Multi-Select Custom Fields Patch By Max Kanat-Alexander r=LpSolit, a=LpSolit --- query.cgi | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'query.cgi') 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 -- cgit v1.2.3-24-g4f1b