summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Group.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-08-31 01:39:05 +0200
committerlpsolit%gmail.com <>2005-08-31 01:39:05 +0200
commit94b607da55ba701e1488a2654a9452acb7ad729b (patch)
tree334b5feb35f01a36d9f023563ab570f0f80039d4 /Bugzilla/Group.pm
parentd6a99db8228a3bee2ee1771fd37e7b45521a6310 (diff)
downloadbugzilla-94b607da55ba701e1488a2654a9452acb7ad729b.tar.gz
bugzilla-94b607da55ba701e1488a2654a9452acb7ad729b.tar.xz
Bug 306271: Group.pm needs a get_all_groups() routine - Patch by Frédéric Buclin <LpSolit@gmail.com> r=joel a=myk
Diffstat (limited to 'Bugzilla/Group.pm')
-rw-r--r--Bugzilla/Group.pm26
1 files changed, 24 insertions, 2 deletions
diff --git a/Bugzilla/Group.pm b/Bugzilla/Group.pm
index 8f4c7885a..54fff489b 100644
--- a/Bugzilla/Group.pm
+++ b/Bugzilla/Group.pm
@@ -145,6 +145,19 @@ sub get_group_controls_by_product {
return $groups;
}
+sub get_all_groups {
+ my $dbh = Bugzilla->dbh;
+
+ my $group_ids = $dbh->selectcol_arrayref('SELECT id FROM groups
+ ORDER BY isbuggroup, name');
+
+ my @groups;
+ foreach my $gid (@$group_ids) {
+ push @groups, new Bugzilla::Group($gid);
+ }
+ return @groups;
+}
+
1;
__END__
@@ -168,8 +181,8 @@ Bugzilla::Group - Bugzilla group class.
my $is_active = $group->is_active;
my $group_id = Bugzilla::Group::ValidateGroupName('admin', @users);
-
- my $grops = Bugzilla::Group::get_group_controls_by_product(1);
+ my $groups = Bugzilla::Group::get_group_controls_by_product(1);
+ my @groups = Bugzilla::get_all_groups();
=head1 DESCRIPTION
@@ -221,6 +234,15 @@ Group.pm represents a Bugzilla Group object.
Returns: A hash with group id as key and hash containing the
group data as value.
+=item C<get_all_groups()>
+
+ Description: Returns all groups available, including both
+ system groups and bug groups.
+
+ Params: none
+
+ Returns: An array of group objects.
+
=back
=cut