Commit c08d220d authored by jake%acutex.net's avatar jake%acutex.net

Refix bug 80289. Don't print header for groups if there aren't any groups to…

Refix bug 80289. Don't print header for groups if there aren't any groups to display (was printing a header without groups in rare instances). Patch by Joe Robins <jmrobins@tgix.com> r= jake@acutex.net
parent 505ec782
...@@ -379,9 +379,7 @@ if ($::usergroupset ne '0') { ...@@ -379,9 +379,7 @@ if ($::usergroupset ne '0') {
"order by description"); "order by description");
# We only print out a header bit for this section if there are any # We only print out a header bit for this section if there are any
# results. # results.
if(MoreSQLData()) { my $groupFound = 0;
print "<br><b>Only users in the selected groups can view this bug:</b><br>\n";
}
while (MoreSQLData()) { while (MoreSQLData()) {
my ($bit, $name, $description, $ison) = (FetchSQLData()); my ($bit, $name, $description, $ison) = (FetchSQLData());
# For product groups, we only want to display the checkbox if either # For product groups, we only want to display the checkbox if either
...@@ -390,6 +388,11 @@ if ($::usergroupset ne '0') { ...@@ -390,6 +388,11 @@ if ($::usergroupset ne '0') {
# All other product groups will be skipped. Non-product bug groups # All other product groups will be skipped. Non-product bug groups
# will still be displayed. # will still be displayed.
if($ison || ($name eq $bug{'product'}) || (!defined $::proddesc{$name})) { if($ison || ($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";
$groupFound = 1;
}
# Modifying this to use checkboxes instead # Modifying this to use checkboxes instead
my $checked = $ison ? " CHECKED" : ""; my $checked = $ison ? " CHECKED" : "";
# indent these a bit # indent these a bit
......
...@@ -413,16 +413,18 @@ if ($::usergroupset ne '0') { ...@@ -413,16 +413,18 @@ if ($::usergroupset ne '0') {
" AND isbuggroup != 0 AND isactive = 1 ORDER BY description"); " AND isbuggroup != 0 AND isactive = 1 ORDER BY description");
# We only print out a header bit for this section if there are any # We only print out a header bit for this section if there are any
# results. # results.
if(MoreSQLData()) { my $groupFound = 0;
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";
}
while (MoreSQLData()) { while (MoreSQLData()) {
my ($bit, $prodname, $description) = (FetchSQLData()); my ($bit, $prodname, $description) = (FetchSQLData());
# Don't want to include product groups other than this product. # Don't want to include product groups other than this product.
unless(($prodname eq $product) || (!defined($::proddesc{$prodname}))) { unless(($prodname eq $product) || (!defined($::proddesc{$prodname}))) {
next; next;
} }
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";
$groupFound = 1;
}
# Rather than waste time with another Param check and another database # Rather than waste time with another Param check and another database
# access, $group_bit will only have a non-zero value if we're using # access, $group_bit will only have a non-zero value if we're using
# bug groups and have one for this product, so I'll check on that # bug groups and have one for this product, so I'll check on that
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment