]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Refix bug 80289. Don't print header for groups if there aren't any groups to display...
authorjake%acutex.net <>
Thu, 28 Jun 2001 22:42:29 +0000 (22:42 +0000)
committerjake%acutex.net <>
Thu, 28 Jun 2001 22:42:29 +0000 (22:42 +0000)
Patch by Joe Robins <jmrobins@tgix.com>
r= jake@acutex.net

bug_form.pl
enter_bug.cgi

index 139e2fcf4d679df799697932933fb4615165d68d..27c19e74ca2fbd5660d3abfd8b46d6e4dffe4a7b 100644 (file)
@@ -379,9 +379,7 @@ if ($::usergroupset ne '0') {
            "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";
-    }
+    my $groupFound = 0;
     while (MoreSQLData()) {
       my ($bit, $name, $description, $ison) = (FetchSQLData());
       # For product groups, we only want to display the checkbox if either
@@ -390,6 +388,11 @@ if ($::usergroupset ne '0') {
       # All other product groups will be skipped.  Non-product bug groups
       # will still be displayed.
       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
         my $checked = $ison ? " CHECKED" : "";
         # indent these a bit
index c78628a6c9d3174ec295c662c42f9bc05842ef89..c1f4e61b15518bb958ccb37c73e4334bce919a1a 100755 (executable)
@@ -413,16 +413,18 @@ if ($::usergroupset ne '0') {
             "  AND isbuggroup != 0 AND isactive = 1 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";
-      print "<font size=\"-1\">(Leave all boxes unchecked to make this a public bug.)</font><br><br>\n";
-    }
+    my $groupFound = 0;
     while (MoreSQLData()) {
         my ($bit, $prodname, $description) = (FetchSQLData());
         # Don't want to include product groups other than this product.
         unless(($prodname eq $product) || (!defined($::proddesc{$prodname}))) {
             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
         # 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