summaryrefslogtreecommitdiffstats
path: root/bug_form.pl
diff options
context:
space:
mode:
authorjustdave%syndicomm.com <>2001-06-27 10:44:32 +0200
committerjustdave%syndicomm.com <>2001-06-27 10:44:32 +0200
commit218999dc8b24961eb2f1e892d9eddb96d70a405f (patch)
tree0ca52ae6ef7b45d36d2d8024f396f1450c92c9c9 /bug_form.pl
parentb6622d0c8e5c133e84b1738f94d318816319dbc6 (diff)
downloadbugzilla-218999dc8b24961eb2f1e892d9eddb96d70a405f.tar.gz
bugzilla-218999dc8b24961eb2f1e892d9eddb96d70a405f.tar.xz
Fix for bug 80289: Group restrictions are now identified with checkboxes instead of select widgets. Also, product groups are now only offered if they are either already set, or match the current product (i.e. the option to set a product bit for a product other than the one the bug is in is no longer available) This results in much less clutter for the admin folks on sites with lots of products.
Patch by Joe Robbins <jmrobins@tgix.com> r= justdave@syndicomm.com
Diffstat (limited to 'bug_form.pl')
-rw-r--r--bug_form.pl35
1 files changed, 23 insertions, 12 deletions
diff --git a/bug_form.pl b/bug_form.pl
index 7801f2754..8e5d251ae 100644
--- a/bug_form.pl
+++ b/bug_form.pl
@@ -368,23 +368,34 @@ print "
if ($::usergroupset ne '0') {
- SendSQL("select bit, description, (bit & $bug{'groupset'} != 0) " .
- "from groups where bit & $::usergroupset != 0 " .
- "and isbuggroup != 0 " .
+ SendSQL("select bit, name, description, (bit & $bug{'groupset'} != 0) " .
+ "from groups where bit & $::usergroupset != 0 " .
+ "and 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)) " .
- "order by bit");
+ "order by description");
+ # We only print out a header bit for this section if there are any
+ # results.
+ if(MoreSQLData()) {
+ print "<br><b>Only users in the selected groups can view this bug:</b><br>\n";
+ }
while (MoreSQLData()) {
- my ($bit, $description, $ison) = (FetchSQLData());
- my $check0 = !$ison ? " SELECTED" : "";
- my $check1 = $ison ? " SELECTED" : "";
- print "<select name=bit-$bit><option value=0$check0>\n";
- print "People not in the \"$description\" group can see this bug\n";
- print "<option value=1$check1>\n";
- print "Only people in the \"$description\" group can see this bug\n";
- print "</select><br>\n";
+ my ($bit, $name, $description, $ison) = (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})) {
+ # Modifying this to use checkboxes instead
+ my $checked = $ison ? " CHECKED" : "";
+ # indent these a bit
+ print "&nbsp;&nbsp;&nbsp;&nbsp;";
+ print "<input type=checkbox name=\"bit-$bit\" value=1$checked>\n";
+ print "$description<br>\n";
+ }
}
}