]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 554964 - Show if a user is a "Default CC" under the Product Responsibilities...
authorReed Loden <reed@reedloden.com>
Tue, 6 Jul 2010 00:44:13 +0000 (19:44 -0500)
committerReed Loden <reed@reedloden.com>
Tue, 6 Jul 2010 00:44:13 +0000 (19:44 -0500)
[r=mkanat a=mkanat]

Bugzilla/Template.pm
Bugzilla/User.pm
template/en/default/admin/users/responsibilities.html.tmpl

index 71ade2f0165744e2ca20763133e1047652503273..4bd3d2d7750e9059d5cd3f4a35470a0e80b80a57 100644 (file)
@@ -380,14 +380,22 @@ $Template::Stash::PRIVATE = undef;
 $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;
   };
index cb3f75fa8fde282b05123d23f9e8486d2ad432ec..b9405e4121cdd2b6d3e774a820c623ca216df69d 100644 (file)
@@ -1152,11 +1152,14 @@ sub product_responsibilities {
     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'} = [];
index bbf121a26515f12569c7ebaa9e660c4170757e06..5c9c3f317ca4263a32933d696600f7f47f5be6a9 100644 (file)
@@ -29,6 +29,7 @@
       <th>Component</th>
       <th>Default Assignee</th>
       <th>Default QA Contact</th>
+      <th>Default CC</th>
     </tr>
     [% FOREACH component = item.components %]
       <tr>
@@ -48,6 +49,9 @@
             [% component.$responsibility.id == otheruser.id ? "X" : "&nbsp;" %]
           </td>
         [% END %]
+        <td class="center">
+          [% component.initial_cc.contains(otheruser) ? "X" : "&nbsp;" %]
+        </td>
       </tr>
     [% END %]
     </tbody>