Received: (from majordom@localhost) by hyperreal.org (8.8.5/8.8.5) id MAA17361; Wed, 30 Jul 1997 12:00:26 -0700 (PDT) Received: (from coar@localhost) by hyperreal.org (8.8.5/8.8.5) id MAA17330 for apache-cvs; Wed, 30 Jul 1997 12:00:19 -0700 (PDT) Date: Wed, 30 Jul 1997 12:00:19 -0700 (PDT) From: Rodent of Unusual Size Message-Id: <199707301900.MAA17330@hyperreal.org> To: apache-cvs@hyperreal.org Subject: cvs commit: apache-site bugdb.cgi Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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 "\n"; #&read_originator; &read_editor; @@ -199,6 +195,7 @@ "Ken Coar ", "Coar\@DECUS.Org\n"; } else { + &emit_preamble (0); print "SPR Front End

SPR Front End

@@ -223,6 +220,25 @@ print "\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 "\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 "Apache: New Problem Report Submission"; # Get arguments @@ -358,6 +375,7 @@ sub send_pr { # Display title + &emit_preamble (0); print <Apache: New Problem Report submission

New Problem Report form:

@@ -483,6 +501,7 @@ local($pr, $oldstate, $timestamp) = @_; # Display title + &emit_preamble (0); print "Problem Report editing for PR#$pr "; @@ -771,6 +790,7 @@ $pr = $_[0]; # Display title + &emit_preamble (0); print "Problem Report editing for PR#$pr\n"; if ($pr eq "") { @@ -919,11 +939,6 @@ sub numerically { $a <=> $b; } sub query_quick { - # Print title - print "Quick summary of PR's -

Quick summary of PR's:

- -"; #print "args = (@_)\n"; local($quickfmt,@restrict)=@_; # 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 "Quick summary of PR's +

Quick summary of PR's:

+ +"; 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 "Summary of active PR's by person and status

Summary of active PR's by person and status:

@@ -1196,6 +1227,7 @@ sub query_summary_cat { # Print title + &emit_preamble (0); print "Summary of PR's by category and status

Summary of PR's by category and status:

@@ -1272,6 +1304,7 @@ sub query_full { local($pr) = $_[0]; + &emit_preamble (0); print "Full Problem Report Text for PR#$pr "; @@ -1303,6 +1336,7 @@ # Very first page of front end sub main_menu { + &emit_preamble (0); print <$databasetitle @@ -1327,8 +1361,13 @@ print "

\n"; # Choose quick output format. - print "
\n"; - print "Output format: \n"; + print "\n"; + print "\n"; + print " +
Go directly to the full display "; + print "for PR# "; + print "
OR

Compose a database query

"; + print ""; + print " +
\nOutput format: \n"; print " Report text
+