diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-03-18 14:11:27 +0100 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-03-18 14:11:27 +0100 |
commit | d0b17e984b42fea65eb4e8ecfd586e958507cb2c (patch) | |
tree | cfa63d20d3f951d0f9b92b956fdb5f410ada9627 | |
parent | e03ba3a9693ea4704d46574d9f6ed5cdcf2504b8 (diff) | |
download | bugzilla-d0b17e984b42fea65eb4e8ecfd586e958507cb2c.tar.gz bugzilla-d0b17e984b42fea65eb4e8ecfd586e958507cb2c.tar.xz |
Bug 395461: Allow multi-select fields to show up in buglist.cgi
r=dkl, a=mkanat
-rw-r--r-- | Bugzilla/Install/DB.pm | 2 | ||||
-rw-r--r-- | Bugzilla/Search.pm | 20 | ||||
-rwxr-xr-x[-rw-r--r--] | contrib/fixperms.pl | 0 | ||||
-rwxr-xr-x | editfields.cgi | 2 |
4 files changed, 21 insertions, 3 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 28f91a23c..1a3ffc69b 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -105,6 +105,8 @@ sub update_fielddefs_definition { #2008-08-26 elliotte_martin@yahoo.com - Bug 251556 $dbh->bz_add_column('fielddefs', 'reverse_desc', {TYPE => 'TINYTEXT'}); + $dbh->do('UPDATE fielddefs SET buglist = 1 + WHERE custom = 1 AND type = ' . FIELD_TYPE_MULTI_SELECT); # Remember, this is not the function for adding general table changes. # That is below. Add new changes to the fielddefs table above this diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 2c36fe233..76c4cd950 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -162,8 +162,18 @@ sub COLUMNS { foreach my $field (Bugzilla->get_fields({ obsolete => 0, buglist => 1 })) { my $id = $field->name; $id = $old_names{$id} if exists $old_names{$id}; - my $sql = 'bugs.' . $field->name; - $sql = $special_sql{$id} if exists $special_sql{$id}; + my $sql; + if (exists $special_sql{$id}) { + $sql = $special_sql{$id}; + } + elsif ($field->type == FIELD_TYPE_MULTI_SELECT) { + $sql = $dbh->sql_group_concat( + 'DISTINCT map_bug_' . $field->name . '.value', + $dbh->quote(', ')); + } + else { + $sql = 'bugs.' . $field->name; + } $columns{$id} = { name => $sql, title => $field->description }; } @@ -273,6 +283,12 @@ sub init { push(@supptables, "LEFT JOIN longdescs AS ldtime " . "ON ldtime.bug_id = bugs.bug_id"); } + foreach my $field (@multi_select_fields) { + my $field_name = $field->name; + next if !grep($_ eq $field_name, @fields); + push(@supptables, "LEFT JOIN bug_$field_name AS map_bug_$field_name" + . " ON map_bug_$field_name.bug_id = bugs.bug_id"); + } if (grep($_ eq 'flagtypes.name', @fields)) { push(@supptables, "LEFT JOIN flags ON flags.bug_id = bugs.bug_id AND attach_id IS NULL"); diff --git a/contrib/fixperms.pl b/contrib/fixperms.pl index 406c149cb..406c149cb 100644..100755 --- a/contrib/fixperms.pl +++ b/contrib/fixperms.pl diff --git a/editfields.cgi b/editfields.cgi index 4e8733752..35f67ae3f 100755 --- a/editfields.cgi +++ b/editfields.cgi @@ -64,7 +64,7 @@ elsif ($action eq 'new') { enter_bug => scalar $cgi->param('enter_bug'), obsolete => scalar $cgi->param('obsolete'), custom => 1, - buglist => (scalar $cgi->param('type') == FIELD_TYPE_MULTI_SELECT ? 0 : 1), + buglist => 1, visibility_field_id => scalar $cgi->param('visibility_field_id'), visibility_value_id => scalar $cgi->param('visibility_value_id'), value_field_id => scalar $cgi->param('value_field_id'), |