]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch by Klaas Freitag <freitag@suse.de>, with modifications by me --
authorterry%mozilla.org <>
Sun, 23 Jan 2000 00:51:49 +0000 (00:51 +0000)
committerterry%mozilla.org <>
Sun, 23 Jan 2000 00:51:49 +0000 (00:51 +0000)
don't generate HTML tables with more than 50 lines, as browsers generally
can't cope with huge tables.

describekeywords.cgi
editkeywords.cgi

index fc0fe10bffc64654663a9bcfeba2687289b47e7a..c80158267605c16a4fa39c6e4c3cc70e7a2bd5ca 100755 (executable)
@@ -31,7 +31,7 @@ print "Content-type: text/html\n\n";
 
 PutHeader("Bugzilla keyword description");
 
-print qq{
+my $tableheader = qq{
 <TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>
 <TR BGCOLOR="#6666FF">
 <TH ALIGN="left">Name</TH>
@@ -40,6 +40,10 @@ print qq{
 </TR>
 };
 
+print $tableheader;
+my $line_count = 0;
+my $max_table_size = 50;
+
 SendSQL("SELECT keyworddefs.name, keyworddefs.description, 
                 COUNT(keywords.bug_id), keywords.bug_id
          FROM keyworddefs LEFT JOIN keywords ON keyworddefs.id=keywords.keywordid
@@ -59,6 +63,11 @@ while (MoreSQLData()) {
     } else {
         $bugs = "none";
     }
+    if ($line_count == $max_table_size) {
+        print "</table>\n$tableheader";
+        $line_count = 0;
+    }
+    $line_count++;
     print qq{
 <TR>
 <TH>$name</TH>
index 3443a5c3f7173196a648c581686d15e79ea99f61..da9ec1b1cb6792d8e4220061c9a3d452abbd70e2 100755 (executable)
@@ -125,7 +125,7 @@ my $action  = trim($::FORM{action}  || '');
 
 if ($action eq "") {
     PutHeader("Select keyword");
-    print qq{
+    my $tableheader = qq{
 <TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>
 <TR BGCOLOR="#6666FF">
 <TH ALIGN="left">Edit keyword ...</TH>
@@ -134,6 +134,10 @@ if ($action eq "") {
 <TH ALIGN="left">Action</TH>
 </TR>
 };
+    print $tableheader;
+    my $line_count = 0;
+    my $max_table_size = 50;
+
     SendSQL("SELECT keyworddefs.id, keyworddefs.name, keyworddefs.description,
                     COUNT(keywords.bug_id), keywords.bug_id
              FROM keyworddefs LEFT JOIN keywords ON keyworddefs.id = keywords.keywordid
@@ -151,6 +155,12 @@ if ($action eq "") {
             # what it had responded.
             $bugs = 'none';
         }
+        if ($line_count == $max_table_size) {
+            print "</table>\n$tableheader";
+            $line_count = 0;
+        }
+        $line_count++;
+            
         print qq{
 <TR>
 <TH VALIGN="top"><A HREF="editkeywords.cgi?action=edit&id=$id">$name</TH>