aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2002-09-23 00:14:48 +0000
committerbugreport%peshkin.net <>2002-09-23 00:14:48 +0000
commit65d3dc0ec33fd76229dc02536a74ccac5408876b (patch)
treebcacbb27e99c73f9548e92408fadb2e369f0543b /enter_bug.cgi
parentFix for bug 63601: Recommend filename when downloading attachments (except in... (diff)
downloadbugzilla-65d3dc0ec33fd76229dc02536a74ccac5408876b.tar.gz
bugzilla-65d3dc0ec33fd76229dc02536a74ccac5408876b.tar.bz2
bugzilla-65d3dc0ec33fd76229dc02536a74ccac5408876b.zip
bug 157756 - Groups_20020716_Branch Tracking : > 55 groups now supported
r=bbaetz, gerv
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi92
1 files changed, 46 insertions, 46 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index a779aa85d..a7733ec3e 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -48,6 +48,7 @@ use vars qw(
@legal_platform
@legal_priority
@legal_severity
+ $userid
%MFORM
%versions
);
@@ -326,60 +327,58 @@ $default{'bug_status'} = $status[0];
# Select whether to restrict this bug to the product's bug group or not,
# if the usebuggroups parameter is set, and if this product has a bug group.
-if ($::usergroupset ne '0') {
- # First we get the bit and description for the group.
- my $group_bit = '0';
-
- if(Param("usebuggroups") && GroupExists($product)) {
- SendSQL("SELECT bit FROM groups ".
- "WHERE name = " . SqlQuote($product) . " " .
- "AND isbuggroup != 0");
- ($group_bit) = FetchSQLData();
- }
-
- SendSQL("SELECT bit, name, description FROM groups " .
- "WHERE bit & $::usergroupset != 0 " .
- "AND isbuggroup != 0 AND isactive = 1 ORDER BY description");
-
- my @groups;
-
- while (MoreSQLData()) {
- my ($bit, $prodname, $description) = FetchSQLData();
- # Don't want to include product groups other than this product.
- next unless($prodname eq $product ||
- !defined($::proddesc{$prodname}));
+# First we get the bit and description for the group.
+my $group_id = '0';
- my $check;
+if(Param("usebuggroups")) {
+ ($group_id) = GroupExists($product);
+}
- # If this is the group for this product, make it checked.
- if(formvalue("maketemplate") eq
- "Remember values as bookmarkable template")
- {
- # If this is a bookmarked template, then we only want to set the
- # bit for those bits set in the template.
- $check = formvalue("bit-$bit", 0);
- }
- else {
- # $group_bit will only have a non-zero value if we're using
- # bug groups and have one for this product.
- # If $group_bit is 0, it won't match the current group, so compare
- # it to the current bit instead of checking for non-zero.
- $check = ($group_bit == $bit);
- }
+SendSQL("SELECT DISTINCT groups.id, groups.name, groups.description " .
+ "FROM groups, user_group_map " .
+ "WHERE user_group_map.group_id = groups.id " .
+ "AND user_group_map.user_id = $::userid " .
+ "AND isbless = 0 " .
+ "AND isbuggroup = 1 AND isactive = 1 ORDER BY description");
- my $group =
- {
- 'bit' => $bit ,
- 'checked' => $check ,
- 'description' => $description
- };
+my @groups;
- push @groups, $group;
+while (MoreSQLData()) {
+ my ($id, $prodname, $description) = FetchSQLData();
+ # Don't want to include product groups other than this product.
+ next unless(!Param("usebuggroups") || $prodname eq $product ||
+ !defined($::proddesc{$prodname}));
+
+ my $check;
+
+ # If this is the group for this product, make it checked.
+ if(formvalue("maketemplate") eq
+ "Remember values as bookmarkable template")
+ {
+ # If this is a bookmarked template, then we only want to set the
+ # bit for those bits set in the template.
+ $check = formvalue("bit-$id", 0);
+ }
+ else {
+ # $group_bit will only have a non-zero value if we're using
+ # bug groups and have one for this product.
+ # If $group_bit is 0, it won't match the current group, so compare
+ # it to the current bit instead of checking for non-zero.
+ $check = ($group_id == $id);
}
- $vars->{'group'} = \@groups;
+ my $group =
+ {
+ 'bit' => $id ,
+ 'checked' => $check ,
+ 'description' => $description
+ };
+
+ push @groups, $group;
}
+$vars->{'group'} = \@groups;
+
$vars->{'default'} = \%default;
my $format =
@@ -388,3 +387,4 @@ my $format =
print "Content-type: $format->{'ctype'}\n\n";
$template->process($format->{'template'}, $vars)
|| ThrowTemplateError($template->error());
+