$Template::Stash::LIST_OPS->{ contains } =
sub {
my ($list, $item) = @_;
- return grep($_ eq $item, @$list);
+ if (ref $item && $item->isa('Bugzilla::Object')) {
+ return grep($_->id == $item->id, @$list);
+ } else {
+ return grep($_ eq $item, @$list);
+ }
};
$Template::Stash::LIST_OPS->{ containsany } =
sub {
my ($list, $items) = @_;
foreach my $item (@$items) {
- return 1 if grep($_ eq $item, @$list);
+ if (ref $item && $item->isa('Bugzilla::Object')) {
+ return 1 if grep($_->id == $item->id, @$list);
+ } else {
+ return 1 if grep($_ eq $item, @$list);
+ }
}
return 0;
};
return $self->{'product_resp'} if defined $self->{'product_resp'};
return [] unless $self->id;
- my $list = $dbh->selectall_arrayref('SELECT product_id, id
+ my $list = $dbh->selectall_arrayref('SELECT components.product_id, components.id
FROM components
- WHERE initialowner = ?
- OR initialqacontact = ?',
- {Slice => {}}, ($self->id, $self->id));
+ LEFT JOIN component_cc
+ ON components.id = component_cc.component_id
+ WHERE components.initialowner = ?
+ OR components.initialqacontact = ?
+ OR component_cc.user_id = ?',
+ {Slice => {}}, ($self->id, $self->id, $self->id));
unless ($list) {
$self->{'product_resp'} = [];
<th>Component</th>
<th>Default Assignee</th>
<th>Default QA Contact</th>
+ <th>Default CC</th>
</tr>
[% FOREACH component = item.components %]
<tr>
[% component.$responsibility.id == otheruser.id ? "X" : " " %]
</td>
[% END %]
+ <td class="center">
+ [% component.initial_cc.contains(otheruser) ? "X" : " " %]
+ </td>
</tr>
[% END %]
</tbody>