Commit 89b2fc2a authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 616192: Display personal tags in buglists

r=timello a=LpSolit
parent 51bca2fc
......@@ -248,7 +248,7 @@ use constant DEFAULT_FIELDS => (
{name => "owner_idle_time", desc => "Time Since Assignee Touched"},
{name => 'see_also', desc => "See Also",
type => FIELD_TYPE_BUG_URLS},
{name => 'tag', desc => 'Tags'},
{name => 'tag', desc => 'Tags', buglist => 1},
);
################
......
......@@ -397,7 +397,11 @@ use constant COLUMN_DEPENDS => {
# certain columns in the buglist. For the most part, Search.pm uses
# DB::Schema to figure out what needs to be joined, but for some
# fields it needs a little help.
use constant COLUMN_JOINS => {
sub COLUMN_JOINS {
my $invocant = shift;
my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user;
my $joins = {
actual_time => {
table => '(SELECT bug_id, SUM(work_time) AS total'
. ' FROM longdescs GROUP BY bug_id)',
......@@ -462,6 +466,19 @@ use constant COLUMN_JOINS => {
table => 'longdescs',
join => 'INNER',
},
tag => {
as => 'map_bug_tag',
table => 'bug_tag',
then_to => {
as => 'map_tag',
table => 'tag',
extra => ['map_tag.user_id = ' . $user->id],
from => 'map_bug_tag.tag_id',
to => 'id',
},
}
};
return $joins;
};
# This constant defines the columns that can be selected in a query
......@@ -527,6 +544,8 @@ sub COLUMNS {
'keywords' => $dbh->sql_group_concat('DISTINCT map_keyworddefs.name'),
'longdescs.count' => 'COUNT(DISTINCT map_longdescs_count.comment_id)',
tag => $dbh->sql_group_concat($dbh->sql_string_concat('map_tag.name')),
);
# Backward-compatibility for old field names. Goes new_name => old_name.
......@@ -1816,7 +1835,7 @@ sub _get_column_joins {
return $cache->{column_joins} if defined $cache->{column_joins};
my %column_joins = %{ COLUMN_JOINS() };
my %column_joins = %{ $self->COLUMN_JOINS() };
Bugzilla::Hook::process('buglist_column_joins',
{ column_joins => \%column_joins });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment