Bugzilla – Attachment 38134 Details for
Bug 14013
Use name of a saved report as part of the file name for download
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14013 - Use name of a saved report as part of the file name for download
Bug-14013---Use-name-of-a-saved-report-as-part-of-.patch (text/plain), 2.50 KB, created by
Marc Véron
on 2015-04-19 16:48:06 UTC
(
hide
)
Description:
Bug 14013 - Use name of a saved report as part of the file name for download
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-04-19 16:48:06 UTC
Size:
2.50 KB
patch
obsolete
>From 9374259e3e7e7b753ad3cf7497843757a3724a71 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sun, 19 Apr 2015 18:40:09 +0200 >Subject: [PATCH] Bug 14013 - Use name of a saved report as part of the file > name for download > >This patch propoeses the name of a saved report as part of the download file name. > >To test: > >- Apply patch >- Got to Home > Reports > Guided reports wizard > Saved reports (or create a new report from sql) >- Run a saved report >- Download the report (as csv, tab, ods) >Result: The downlaod file name proposed should be prepended by the report name, separated with a - > >- Bonus test: Try to downlaod saved reports which have special character in their name. >--- > .../intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt | 1 + > reports/guided_reports.pl | 4 +++- > 2 files changed, 4 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index d2420a0..d77824d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -841,6 +841,7 @@ canned reports and writing custom SQL reports.</p> > <input type="hidden" name="sql" value="[% sql |html %]" /> > <input type="hidden" name="phase" value="Export" /> > <input type="submit" name="submit" value="Download" /></fieldset> >+<input type="hidden" name="reportname" value="[% name %]" /> > </form> > [% END %] > [% END %] >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index a3009b2..93b9569 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -797,6 +797,8 @@ elsif ($phase eq 'Export'){ > # export results to tab separated text or CSV > my $sql = $input->param('sql'); # FIXME: use sql from saved report ID#, not new user-supplied SQL! > my $format = $input->param('format'); >+ my $reportname = $input->param('reportname'); >+ my $reportfilename = $reportname ? "$reportname-reportresults.$format" : "reportresults.$format" ; > my ($sth, $q_errors) = execute_query($sql); > unless ($q_errors and @$q_errors) { > my ( $type, $content ); >@@ -870,7 +872,7 @@ elsif ($phase eq 'Export'){ > } > print $input->header( > -type => $type, >- -attachment=>"reportresults.$format" >+ -attachment=> $reportfilename > ); > print $content; > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14013
:
38134
|
38135
|
38173