coar 97/07/30 12:00:17
Modified: . bugdb.cgi Log: Add a "go directly to PR# N" option on the main menu (requested overtly by Dean, but I think several people have mentioned it). Revision Changes Path 1.10 +56 -14 apache-site/bugdb.cgi Index: bugdb.cgi =================================================================== RCS file: /export/home/cvs/apache-site/bugdb.cgi,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- bugdb.cgi 1997/07/30 17:55:36 1.9 +++ bugdb.cgi 1997/07/30 19:00:14 1.10 @@ -48,7 +48,8 @@ # may be unsatisfying. # 7/30/1997 Ken Coar - add PR# link at extreme right if there are more # than 4 columns - easier to follow link without having to -# horizontally scroll back. +# horizontally scroll back. Also added field to let you go directly +# to a particular PR from the main menu (prompted by Dean Gaudet). # ### End Modification log @@ -120,11 +121,6 @@ #################### Main routine # Main Program -select (STDOUT); -$| = 1; -print "Content-type: text/html\n\n"; -$| = 0; -print "<HTML>\n"; #&read_originator; &read_editor; @@ -199,6 +195,7 @@ "<A HREF=\"http://www.golux.com/coar/\">Ken Coar</A> ", "[EMAIL PROTECTED]</SMALL>\n"; } else { + &emit_preamble (0); print "<head><title>SPR Front End</title></head> <H1>SPR Front End</H1> <body> @@ -223,6 +220,25 @@ print "</pre>\n"; } +# +# Emits either a rredirect or the preamble to some HTML. +# +sub emit_preamble { + local ($redirect, $target, $oldsel) = @_; + + $oldsel = select (STDOUT); + $| = 1; + if ($redirect) { + print "Location: $target\n\n"; + } else { + print "Content-type: text/html\n\n"; + print "<HTML>\n"; + } + $| = 0; + select ($oldsel); + return 0; +} + # Translates '+' to ' ' and '%##' to 'chr(0x##)' sub cgi_trans { @@ -281,6 +297,7 @@ # Sends the new PR sub handle_send_pr { # Display title + &emit_preamble (0); print "<head><title>Apache: New Problem Report Submission</title></head><body>"; # Get arguments @@ -358,6 +375,7 @@ sub send_pr { # Display title + &emit_preamble (0); print <<EOHT; <HEAD><TITLE>Apache: New Problem Report submission</TITLE></HEAD> <H2>New Problem Report form:</H2> @@ -483,6 +501,7 @@ local($pr, $oldstate, $timestamp) = @_; # Display title + &emit_preamble (0); print "<head><title>Problem Report editing for PR#$pr</title></head> <body> "; @@ -771,6 +790,7 @@ $pr = $_[0]; # Display title + &emit_preamble (0); print "<HEAD><TITLE>Problem Report editing for PR#$pr</TITLE></HEAD><BODY>\n"; if ($pr eq "") { @@ -919,11 +939,6 @@ sub numerically { $a <=> $b; } sub query_quick { - # Print title - print "<head><title>Quick summary of PR's</title></head> -<H2>Quick summary of PR's:</H2> -<body> -"; #print "args = (@_)\n"; local($quickfmt,@restrict)[EMAIL PROTECTED]; # Convert $quickfmt to index into @quickfmt @@ -961,7 +976,15 @@ $restrict{$oldkey} = $oldval; } # - # Now let's remove form-fields that don't equate to GNATS-fields. + # If we were given an explicit PR number, redirect the browser + # there. + # + if ($oldval = $restrict{'pr'}) { + return &emit_preamble (1, "http:$SCRIPT_NAME/full/$oldval"); + } + # + # Nope, it's a real query. Now let's remove form-fields that don't + # equate to GNATS-fields. # $oldval = $restrict{"search"}; if ($oldval && $restrict{"qstring"}) { @@ -970,6 +993,13 @@ delete $restrict{"string"}; delete $restrict{"qstring"}; delete $restrict{"search"}; + + # Print title + &emit_preamble (0); + print "<head><title>Quick summary of PR's</title></head> +<H2>Quick summary of PR's:</H2> +<body> +"; local($opts); local(@prs); # Read in quick format list of pr's matching query @@ -1107,6 +1137,7 @@ sub query_summary { # Print title + &emit_preamble (0); print "<head><title>Summary of active PR's by person and status</title></head> <H2>Summary of active PR's by person and status:</H2> <body> @@ -1196,6 +1227,7 @@ sub query_summary_cat { # Print title + &emit_preamble (0); print "<head><title>Summary of PR's by category and status</title></head> <H2>Summary of PR's by category and status:</H2> <body> @@ -1272,6 +1304,7 @@ sub query_full { local($pr) = $_[0]; + &emit_preamble (0); print "<head><title>Full Problem Report Text for PR#$pr</title></head> <body> "; @@ -1303,6 +1336,7 @@ # Very first page of front end sub main_menu { + &emit_preamble (0); print <<EOM; <head><title>$databasetitle</title></head> <body> @@ -1327,8 +1361,13 @@ print "<P><FORM ACTION=\"$SCRIPT_NAME/quick\">\n"; # Choose quick output format. - print "<TABLE BORDER=0><TR><TD align=right>\n"; - print "Output format: \n"; + print "<TABLE BORDER=1><TR>\n"; + print "<TD ALIGN=\"CENTER\">Go directly to the full display "; + print "for PR# <INPUT TYPE=\"text\" NAME=\"PR\" SIZE=4>"; + print "<BR><STRONG><EM>OR</EM></STRONG></TD></TR><TR>\n"; + print "<TD ALIGN=\"CENTER\"><P><STRONG>Compose a database query</STRONG></P>"; + print "<TABLE BORDER=0><TR>"; + print "<TD align=right>\nOutput format: \n"; print "<SELECT NAME=\"quickfmt\">\n"; foreach (@quickfmt) { print "<OPTION", ($_ eq "regular") ? " SELECTED" : "", "> $_\n"; @@ -1369,6 +1408,9 @@ <INPUT TYPE="radio" NAME="search" VALUE="multitext" CHECKED> Report text<BR> <INPUT TYPE="text" NAME="qstring" SIZE=24> </TD></TR> +</TABLE> +</TD> +</TR> </TABLE> <P> <INPUT TYPE="submit" VALUE="Search the bug database">