summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-06-25 07:33:05 +0200
committerlpsolit%gmail.com <>2005-06-25 07:33:05 +0200
commit05cc6289d00b21e12d4d59282384b8729a5c2b57 (patch)
treefdf103232c9428fe4c9f88b885afa790abc72f8d /Bugzilla/User.pm
parent5609425d739829a7c26840b021e3a89dceb34005 (diff)
downloadbugzilla-05cc6289d00b21e12d4d59282384b8729a5c2b57.tar.gz
bugzilla-05cc6289d00b21e12d4d59282384b8729a5c2b57.tar.xz
Bug 284273: Move productResponsibilities from editusers.cgi to Bugzilla::User.pm - Patch by Marc Schumann <wurblzap@gmail.com> r=mkanat a=justdave
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm47
1 files changed, 47 insertions, 0 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 87239bc6e..3e68647c6 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -530,6 +530,27 @@ sub derive_groups {
$dbh->bz_unlock_tables() unless $already_locked;
}
+sub product_responsibilities {
+ my $self = shift;
+
+ return $self->{'product_resp'} if defined $self->{'product_resp'};
+ return [] unless $self->id;
+
+ my $h = Bugzilla->dbh->selectall_arrayref(
+ qq{SELECT products.name AS productname,
+ components.name AS componentname,
+ initialowner,
+ initialqacontact
+ FROM products, components
+ WHERE products.id = components.product_id
+ AND ? IN (initialowner, initialqacontact)
+ },
+ {'Slice' => {}}, $self->id);
+ $self->{'product_resp'} = $h;
+
+ return $h;
+}
+
sub can_bless {
my $self = shift;
@@ -1386,6 +1407,32 @@ all MySQL supported, this will go away.
=end undocumented
+=item C<product_responsibilities>
+
+Retrieve user's product responsibilities as a list of hashes.
+One hash per Bugzilla component the user has a responsibility for.
+These are the hash keys:
+
+=over
+
+=item productname
+
+Name of the product.
+
+=item componentname
+
+Name of the component.
+
+=item initialowner
+
+User ID of default assignee.
+
+=item initialqacontact
+
+User ID of default QA contact.
+
+=back
+
=item C<can_bless>
When called with no arguments: