From 4b650396251bd38ec3dfac75cdcd766a645a72e4 Mon Sep 17 00:00:00 2001 From: "bbaetz%cs.mcgill.ca" <> Date: Thu, 8 Nov 2001 00:11:33 +0000 Subject: Bug 101166 - users seeing a bug via _accessible bits should see that its the group r=justdave,jake --- bug_form.pl | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'bug_form.pl') diff --git a/bug_form.pl b/bug_form.pl index b815fbc13..67829d111 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -358,39 +358,50 @@ print "
"; -if ($::usergroupset ne '0') { - SendSQL("select bit, name, description, (bit & $bug{'groupset'} != 0) " . - "from groups where bit & $::usergroupset != 0 " . - "and isbuggroup != 0 " . +if ($::usergroupset ne '0' || $bug{'groupset'} ne '0') { + SendSQL("select bit, name, description, (bit & $bug{'groupset'} != 0), " . + "(bit & $::usergroupset != 0) from groups where isbuggroup != 0 " . # Include active groups as well as inactive groups to which # the bug already belongs. This way the bug can be removed # from an inactive group but can only be added to active ones. - "and (isactive = 1 or (bit & $bug{'groupset'} != 0)) " . + "and ((isactive = 1 and (bit & $::usergroupset != 0)) or " . + "(bit & $bug{'groupset'} != 0)) " . "order by description"); # We only print out a header bit for this section if there are any # results. my $groupFound = 0; + my $inAllGroups = 1; while (MoreSQLData()) { - my ($bit, $name, $description, $ison) = (FetchSQLData()); + my ($bit, $name, $description, $ison, $ingroup) = (FetchSQLData()); # For product groups, we only want to display the checkbox if either # (1) The bit is already set, or - # (2) It's the group for this product. - # All other product groups will be skipped. Non-product bug groups - # will still be displayed. - if($ison || ($name eq $bug{'product'}) || (!defined $::proddesc{$name})) { + # (2) The user is in the group, but either: + # (a) The group is a product group for the current product, or + # (b) The group name isn't a product name + # This measns that all product groups will be skipped, but non-product + # bug groups will still be displayed. + if($ison || ($ingroup && (($name eq $bug{'product'}) || + (!defined $::proddesc{$name})))) { if(!$groupFound) { print "
Only users in the selected groups can view this bug:
\n"; - print "(Leave all boxes unchecked to make this a public bug.)

\n"; + print "(Unchecking all boxes makes this a public bug.)

\n"; $groupFound = 1; } + if(!$ingroup) { + $inAllGroups = 0; + } # Modifying this to use checkboxes instead my $checked = $ison ? " CHECKED" : ""; + my $disabled = $ingroup ? "" : " DISABLED=\"disabled\""; # indent these a bit print "    "; - print "\n"; + print "\n"; print "$description
\n"; } } + if (!$inAllGroups) { + print "Only members of a group can change the visibility of a bug for that group
"; + } # If the bug is restricted to a group, display checkboxes that allow # the user to set whether or not the reporter, assignee, QA contact, -- cgit v1.2.3-24-g4f1b