[Koha-patches] [PATCH] Fix the guided report export, bad check of errors(bug #2672)
henridamien.laurent at biblibre.com
henridamien.laurent at biblibre.com
Fri Mar 6 11:37:52 CET 2009
From: Nahuel Angelinetti <nahuel.angelinetti at biblibre.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent at biblibre.com>
---
reports/guided_reports.pl | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl
index eb50d65..390243e 100755
--- a/reports/guided_reports.pl
+++ b/reports/guided_reports.pl
@@ -19,10 +19,10 @@
use strict;
use CGI;
-use C4::Reports::Guided;
+use C4::Reports;
use C4::Auth;
use C4::Output;
-use C4::Dates;
+use C4::Dates qw( DHTMLcalendar );
use C4::Debug;
=head1 NAME
@@ -45,7 +45,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { reports => 1 },
+ flagsrequired => { editcatalogue => 1 },
debug => 1,
}
);
@@ -65,7 +65,7 @@ elsif ( $phase eq 'Build new' ) {
$template->param( 'build1' => 1 );
# get report areas
- my $areas = get_report_areas();
+ my $areas = C4::Reports::get_report_areas();
$template->param( 'areas' => $areas );
}
@@ -123,7 +123,7 @@ elsif ( $phase eq 'Report on this Area' ) {
);
# get report types
- my $types = get_report_types();
+ my $types = C4::Reports::get_report_types();
$template->param( 'types' => $types );
}
@@ -397,13 +397,11 @@ elsif ($phase eq 'Run this report'){
}
elsif ($phase eq 'Export'){
- binmode STDOUT, ':utf8';
-
# export results to tab separated text
my $sql = $input->param('sql');
my $format = $input->param('format');
my ($results, $total, $errors) = execute_query($sql,1,0,0,$format);
- if ($#$errors == -1) {
+ if (!@$errors) {
$no_html=1;
print $input->header( -type => 'application/octet-stream',
-attachment=>'reportresults.csv'
@@ -432,7 +430,7 @@ elsif ($phase eq 'Create report from SQL') {
);
}
$template->param('create' => 1);
- my $types = get_report_types();
+ my $types = C4::Reports::get_report_types();
if (my $type = $input->param('type')) {
for my $i ( 0 .. $#{@$types}) {
@$types[$i]->{'selected'} = 1 if @$types[$i]->{'id'} eq $type;
--
1.5.6.3
More information about the Koha-patches
mailing list