Bug 4937: Fixes XHTML in the pagination links of a saved report.
[koha_gimpoz] / reports / guided_reports.pl
index 9c0998d..a53712e 100755 (executable)
@@ -18,7 +18,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
-# use warnings;  # FIXME
+#use warnings; FIXME - Bug 2505
 use CGI;
 use Text::CSV;
 use C4::Reports::Guided;
@@ -36,19 +36,17 @@ guided_reports.pl
 
 Script to control the guided report creation
 
-=over2
-
 =cut
 
 my $input = new CGI;
 
 my $phase = $input->param('phase');
 my $flagsrequired;
-if ( $phase eq 'Build new' ) {
-    $flagsrequired = 'create_report';
+if ( $phase eq 'Build new' or $phase eq 'Delete Saved' ) {
+    $flagsrequired = 'create_reports';
 }
 elsif ( $phase eq 'Use saved' ) {
-    $flagsrequired = 'execute_report';
+    $flagsrequired = 'execute_reports';
 } else {
     $flagsrequired = '*';
 }
@@ -234,7 +232,6 @@ elsif ( $phase eq 'Choose these criteria' ) {
             $query_criteria .= " AND $crit='$value'";
         }
        }
-       warn $query_criteria;
     }
 
     $template->param(
@@ -501,7 +498,7 @@ elsif ($phase eq 'Run this report'){
         }
 
         my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0);
-        my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report&phase=Run%20this%20report";
+        my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report&phase=Run%20this%20report";
         $template->param(
             'results' => \@rows,
             'sql'     => $sql,
@@ -601,18 +598,6 @@ sub header_cell_loop {
     return \@headers;
 }
 
-# pass $sth, get back an array of names for the column headers
-sub header_cell_values {
-    my $sth = shift or return ();
-    return @{$sth->{NAME}};
-}
-
-# pass $sth, get back a TMPL_LOOP-able set of names for the column headers
-sub header_cell_loop {
-    my @headers = map { +{ cell => $_ } } header_cell_values (shift);
-    return \@headers;
-}
-
 foreach (1..6) {
     $template->param('build' . $_) and $template->param(buildx => $_) and last;
 }