httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject [PATCH] to enhance bugdb.cgi (take 2.5)
Date Fri, 25 Apr 1997 09:53:05 GMT
    Additions based upon buffering discussion and Roy's correction:

     o Adds searchability by class (change-request, sw-bug, ...)
     o Adds PR # to <TITLE> and <H1> on full display page
     o Likewise for severity (critical, non-critical, ...)
     o Allows changing both of these when editing
     o Translates CRs into newlines (s/\r\n/\n/, s/\r/\n/) in multiline
       fields - all occurrences
     o Unbuffers STDOUT pipe to Apache, but only for HTTP headers
     o Fixes an escaping bug (unescaped '@' in a string)
     o Requests "uname -a" in the environment section of new PRs
     o Whinges to user if any of the following fields are blank:
       Synopsis, emailaddr, Environment, Category, or Description

    You can test-drive it at

     http://dev.apache.org/~coar/bugdb.cgi

    The usual access information applies.

    #ken    :-)}


Index: bugdb.cgi
===================================================================
RCS file: /export/home/cvs/apache-site/bugdb.cgi,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 bugdb.cgi
*** bugdb.cgi	1997/03/25 04:43:15	1.1.1.1
--- bugdb.cgi	1997/04/25 09:20:26
***************
*** 87,107 ****
--- 87,114 ----
     # The first field is the restriction, the second field is the default option
  %quickrestr = (
  		"Category",    "any",
+ 		"Severity",    "any",
  		"Responsible", "any",
  #		"Originator",  "any",
+ 		"Class",       "any",
  		"State",       "open",
  	    );
     # Defines order of quick output restrictions
  @quickrestr = (
  		"Category",
+ 		"Severity",
  		"Responsible",
  #		"Originator",
+ 		"Class",
  		"State",
  	    );
  
  #################### Main routine
  # Main Program
+ select (STDOUT);
+ $| = 1;
  print "Content-type: text/html\n\n";
+ $| = 0;
  print "<HTML>\n";
  
  #&read_originator;
***************
*** 166,172 ****
  ### Main menu
  } elsif ($PATH_INFO eq "") {
      &main_menu();
!     print"<HR><SMALL>Version: 24 Aug 96<BR>Authors: <A HREF=\"http://alumni.caltech.edu/~dank\">Dan
Kegel</A> dank\@alumni.caltech.edu & <A HREF=\"http://alumni.caltech.edu/~huyle/\">Huy
Le</A> huyle\@alumni.caltech.edu, with revamp work by <A HREF=\"http://www.organic.com\">Brian
Behlendorf</A> brian@organic.com.</SMALL>\n";
  } else {
      print "<head><title>SPR Front End</title></head>
  <H1>SPR Front End</H1>
--- 173,179 ----
  ### Main menu
  } elsif ($PATH_INFO eq "") {
      &main_menu();
!     print"<HR><SMALL>Version: 24 Aug 96<BR>Authors: <A HREF=\"http://alumni.caltech.edu/~dank\">Dan
Kegel</A> dank\@alumni.caltech.edu & <A HREF=\"http://alumni.caltech.edu/~huyle/\">Huy
Le</A> huyle\@alumni.caltech.edu, with revamp work by <A HREF=\"http://www.organic.com\">Brian
Behlendorf</A> brian\@organic.com.</SMALL>\n";
  } else {
      print "<head><title>SPR Front End</title></head>
  <H1>SPR Front End</H1>
***************
*** 263,282 ****
  	$value = &cgi_trans($value);
  	# By convention, multi-line fields have newlines at end of
  	# each line.  I think some browsers forget the last newline?
! 	if ($fieldnames_multi{$key} > 0 && $value !~ /\n$/) {
! 	    $value .= "\n";
  	}
          $fieldvalues{$key}=$value;
      }
  
      # Verify arguments
!     local($field);
!     foreach $field ("Category") {
! 	if ($fieldvalues{$field} eq "") {
! 	    print "<H3>Your problem report has not been sent.</H3>\n";
! 	    print "You must select a $field.\n";
! 	    return;
  	}
      }
  
      # kludge
--- 270,309 ----
  	$value = &cgi_trans($value);
  	# By convention, multi-line fields have newlines at end of
  	# each line.  I think some browsers forget the last newline?
! 	if ($fieldnames_multi{$key} > 0) {
! 	    #
! 	    # Convert any CR-LFs or CRs to \n (different browsers use
! 	    # different line terminators).
! 	    #
! 	    $value =~ s/\r\n/\n/g;
! 	    $value =~ s/\r/\n/g;
! 	    if ($value !~ /\n$/) {
! 		$value .= "\n";
! 	    }
  	}
          $fieldvalues{$key}=$value;
      }
  
      # Verify arguments
!     local($field, $ok, @emsgs) = (0, 1);
!     foreach $field ("Synopsis", "emailaddr", "Environment", "Category", "Description") {
! 	local ($fieldval) = $fieldvalues{$field};
! 	$fieldval =~ s/\s//g;
! 	if ($fieldval eq "") {
! 	    push (@emsgs, $field);
! 	    $ok = 0;
! 	}
!     }
!     if (! $ok) {
! 	print "<H3>Problem report not sent!</H3>\n";
! 	print "Your problem report is missing required information:\n";
! 	print "<UL>\n";
! 	foreach $field (@emsgs) {
! 	    print " <LI>$field\n </LI>\n";
  	}
+ 	print "</UL>";
+ 	print "<P>Please go back to the form and correct this.</P>\n";
+ 	return;
      }
  
      # kludge
***************
*** 363,369 ****
  
      print <<EOM
  <P>
! <B>Environment</B> - What operating system, at what patchlevel?  What compiler?
 Etc.<BR>
  <TEXTAREA NAME="Environment" COLS=$width ROWS=$height></TEXTAREA><BR>
  <B>Synopsis</B> - a brief description of the problem at hand.<BR>
  <INPUT NAME="Synopsis" SIZE=$width><BR>
--- 390,397 ----
  
      print <<EOM
  <P>
! <B>Environment</B> - What operating system, at what patchlevel?  
! What compiler?  Etc. (The output from <CODE>uname -a</CODE> is very useful.)<BR>
  <TEXTAREA NAME="Environment" COLS=$width ROWS=$height></TEXTAREA><BR>
  <B>Synopsis</B> - a brief description of the problem at hand.<BR>
  <INPUT NAME="Synopsis" SIZE=$width><BR>
***************
*** 488,493 ****
--- 516,539 ----
  	    $fieldvalues{'State'} = $input{'State'};
  	}
  
+ 	if ($input{"Class"} ne $fieldvalues{'Class'}) {
+ 	    $change_msg .= "Class-Changed-From-To: $fieldvalues{'Class'}-$input{'Class'}
+ Class-Changed-By: $input{'Editor'}
+ Class-Changed-When: $date
+ ";
+ 	    $to_old = $to_subm = 1;
+ 	    $fieldvalues{'Class'} = $input{'Class'};
+ 	}
+ 
+ 	if ($input{"Severity"} ne $fieldvalues{'Severity'}) {
+ 	    $change_msg .= "Severity-Changed-From-To: $fieldvalues{'Severity'}-$input{'Severity'}
+ Severity-Changed-By: $input{'Editor'}
+ Severity-Changed-When: $date
+ ";
+ 	    $to_old = $to_subm = 1;
+ 	    $fieldvalues{'Severity'} = $input{'Severity'};
+ 	}
+ 
  	#print "if ($input{'Responsible'} ne $oldresp)\n";
  	if ($input{'Responsible'} ne $oldresp) {
  	    if ($input{'ResponsibleReason'} eq "") {
***************
*** 633,638 ****
--- 679,686 ----
      local($oldsyn) = $fieldvalues{"Synopsis"};
      local($oldstate) = $fieldvalues{"State"};
      local($oldresp) = $fieldvalues{"Responsible"};
+     local($oldclass) = $fieldvalues{"Class"};
+     local($oldsev) = $fieldvalues{"Severity"};
      $oldresp =~ s/\s*\(.*$//; # Get rid of comment in responsible party name
  
      local($timestamp)=&timestamp($fullpr);
***************
*** 662,667 ****
--- 710,735 ----
      }
      print "</SELECT><BR>\n";
  
+     print "
+ <dt>Class:
+ <dd><SELECT NAME=\"Class\">\n";
+     for (sort (@nClass)) {
+         $sel = "";
+ 	$sel = " SELECTED" if ($_ eq $oldclass);
+ 	print "<OPTION$sel> $_\n";
+     }
+     print "</SELECT><BR>\n";
+ 
+     print "
+ <dt>Severity:
+ <dd><SELECT NAME=\"Severity\">\n";
+     for (sort (@nSeverity)) {
+         $sel = "";
+ 	$sel = " SELECTED" if ($_ eq $oldsev);
+ 	print "<OPTION$sel> $_\n";
+     }
+     print "</SELECT><BR>\n";
+ 
      print "<dt>New <a href=\"$GNUINFOSCRIPT?(gnats.info)States\">state</a>:\n";
      print "<dd>";
      print "<SELECT NAME=\"State\">\n";
***************
*** 1062,1068 ****
  sub query_full
  {
      local($pr) = $_[0];
!     print "<head><title>Full Problem Report Text</title></head>
  <body>
  ";
      if ($pr eq "") {
--- 1130,1136 ----
  sub query_full
  {
      local($pr) = $_[0];
!     print "<head><title>Full Problem Report Text for PR#$pr</title></head>
  <body>
  ";
      if ($pr eq "") {

Mime
View raw message