Fix improper href's in Clark Kent "back" links on debug report page user/mrpeters-isl/clark_kent_back_links
authorMichael Peters <mrpeters@library.in.gov>
Wed, 28 Sep 2011 15:02:41 +0000 (11:02 -0400)
committerMichael Peters <mrpeters@library.in.gov>
Wed, 28 Sep 2011 15:09:59 +0000 (11:09 -0400)
This patch fixes the incorrect hrefs to filesystem paths in the reporter's debug outputs.
Also adds a "Back to Report Index" link on the HTML output, where going back was previously
impossible.  Thanks to Thomas Berezansky for the inspiration.

Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Open-ILS/src/reporter/clark-kent.pl

index d618782..190539a 100755 (executable)
@@ -477,13 +477,13 @@ sub build_html {
        print $debug "<html><head><title>DEBUG: $$r{report}{name}</title></head><body>";
 
        {       no warnings;
-               print $debug '<h1>Generated SQL</h1><pre>' . $r->{resultset}->toSQL() . "</pre><a href='$file'>Back to output index</a><hr/>";
-               print $debug '<h1>Template</h1><pre>' . Dumper( $r->{report}->{template} ) . "</pre><a href='$file'>Back to output index</a><hr/>";
-               print $debug '<h1>Template Data</h1><pre>' . Dumper( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{template}->{data} ) ) . "</pre><a href='$file'>Back to output index</a><hr/>";
-               print $debug '<h1>Report Parameter</h1><pre>' . Dumper( $r->{report} ) . "</pre><a href='$file'>Back to output index</a><hr/>";
-               print $debug '<h1>Report Parameter Data</h1><pre>' . Dumper( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{data} ) ) . "</pre><a href='$file'>Back to output index</a><hr/>";
-               print $debug '<h1>Report Run Time</h1><pre>' . $r->{resultset}->relative_time . "</pre><a href='$file'>Back to output index</a><hr/>";
-               print $debug '<h1>OpenILS::Reporter::SQLBuilder::ResultSet Object</h1><pre>' . Dumper( $r->{resultset} ) . "</pre><a href='$file'>Back to output index</a>";
+               print $debug '<h1>Generated SQL</h1><pre>' . $r->{resultset}->toSQL() . "</pre><a href='report-data.html'>Back to output index</a><hr/>";
+               print $debug '<h1>Template</h1><pre>' . Dumper( $r->{report}->{template} ) . "</pre><a href='report-data.html'>Back to output index</a><hr/>";
+               print $debug '<h1>Template Data</h1><pre>' . Dumper( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{template}->{data} ) ) . "</pre><a href='report-data.html'>Back to output index</a><hr/>";
+               print $debug '<h1>Report Parameter</h1><pre>' . Dumper( $r->{report} ) . "</pre><a href='report-data.html'>Back to output index</a><hr/>";
+               print $debug '<h1>Report Parameter Data</h1><pre>' . Dumper( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{data} ) ) . "</pre><a href='report-data.html'>Back to output index</a><hr/>";
+               print $debug '<h1>Report Run Time</h1><pre>' . $r->{resultset}->relative_time . "</pre><a href='report-data.html'>Back to output index</a><hr/>";
+               print $debug '<h1>OpenILS::Reporter::SQLBuilder::ResultSet Object</h1><pre>' . Dumper( $r->{resultset} ) . "</pre><a href='report-data.html'>Back to output index</a>";
        }
 
        print $debug '</body></html>';
@@ -507,7 +507,7 @@ sub build_html {
                        </style>
                CSS
 
-               print $raw "</head><body><table>";
+               print $raw "</head><body><a href='report-data.html'>Back to output index</a><br><table>";
 
                {       no warnings;
                        print $raw "<tr><th>".join('</th><th>',@{$r->{column_labels}}).'</th></tr>';