diff options
author | bbaetz%cs.mcgill.ca <> | 2001-11-08 01:11:33 +0100 |
---|---|---|
committer | bbaetz%cs.mcgill.ca <> | 2001-11-08 01:11:33 +0100 |
commit | 4b650396251bd38ec3dfac75cdcd766a645a72e4 (patch) | |
tree | a62cb3e6ec8e7439ccc11a9e0f774fcad417cff8 | |
parent | 4d26270e7c1984e8c1adf789f484d6e937019ef6 (diff) | |
download | bugzilla-4b650396251bd38ec3dfac75cdcd766a645a72e4.tar.gz bugzilla-4b650396251bd38ec3dfac75cdcd766a645a72e4.tar.xz |
Bug 101166 - users seeing a bug via _accessible bits should see that its
the group
r=justdave,jake
-rw-r--r-- | bug_form.pl | 35 |
1 files changed, 23 insertions, 12 deletions
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 " <TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80></TEXTAREA><BR>"; -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 "<br><b>Only users in the selected groups can view this bug:</b><br>\n"; - print "<font size=\"-1\">(Leave all boxes unchecked to make this a public bug.)</font><br><br>\n"; + print "<font size=\"-1\">(Unchecking all boxes makes this a public bug.)</font><br><br>\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 "<input type=checkbox name=\"bit-$bit\" value=1$checked>\n"; + print "<input type=checkbox name=\"bit-$bit\" value=1$checked$disabled>\n"; print "$description<br>\n"; } } + if (!$inAllGroups) { + print "<b>Only members of a group can change the visibility of a bug for that group</b><br>"; + } # If the bug is restricted to a group, display checkboxes that allow # the user to set whether or not the reporter, assignee, QA contact, |