From b2706884a1916827229ad6f818790ec47a43cbf5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sun, 24 May 2015 17:52:25 +0200 Subject: [PATCH] Bug 14264: Fix export of late orders when translated Bug 7298 tried to fix this issue, but it was not correct. We have 3 files in acqui/csv: basketgroup.tt, basket.tt and lateorders.tt The first 2 don't contain translatable string, and are not modified on translating the templates (`translate install`) On the contrary, lateorders.tt has some strings to translate ('Author:', 'Published by:', etc.). After being translated, all carriage returns between TT tags are removed. Test plan: 1/ choose a language and update + translate the templates for instance: cd misc/translate; ./translate update es-ES; ./translate install es-ES 2/ Go to acqui/lateorders.pl using this language 3/ Generate a csv for 1+ late orders and confirm the first line only contains the headers. Signed-off-by: Laurence Lefaucheur Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- acqui/lateorders-export.pl | 4 +++- .../intranet-tmpl/prog/en/modules/acqui/csv/lateorders.tt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/acqui/lateorders-export.pl b/acqui/lateorders-export.pl index 96a182420d..2028eda560 100755 --- a/acqui/lateorders-export.pl +++ b/acqui/lateorders-export.pl @@ -62,4 +62,6 @@ print $input->header( -attachment => 'lateorders.csv', ); $template->param( orders => \@orders ); -print $template->output; +for my $line ( split '\n', $template->output ) { + print "$line\n" unless $line =~ m|^\s*$|; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/lateorders.tt index 34d9db015d..2e24b673d4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/lateorders.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/lateorders.tt @@ -1,5 +1,5 @@ [% USE KohaDates %][% INCLUDE csv_headers/acqui/lateorders.tt %] -[% FOREACH o IN orders %]"[% o.orderdate %] ([% o.latesince %] days)","[% o.estimateddeliverydate | $KohaDates %]","[% o.supplier (o.supplierid) %]","[% o.title %] [% IF o.author %]Author: [% o.author %].[% END %][% IF o.publisher %]Published by: [% o.publisher %].[% END %]","[% o.unitpricesupplier %] x [% o.quantity_to_receive %] = [% o.subtotal %] ([% o.budget %])","[% o.basketname %] ([% o.basketno %])","[% o.claims_count %]","[% o.claimed_date %]" +[% FOREACH o IN orders %][% INCLUDE 'empty_line.inc' %]"[% o.orderdate %] ([% o.latesince %] days)","[% o.estimateddeliverydate | $KohaDates %]","[% o.supplier (o.supplierid) %]","[% o.title %] [% IF o.author %]Author: [% o.author %].[% END %][% IF o.publisher %]Published by: [% o.publisher %].[% END %]","[% o.unitpricesupplier %] x [% o.quantity_to_receive %] = [% o.subtotal %] ([% o.budget %])","[% o.basketname %] ([% o.basketno %])","[% o.claims_count %]","[% o.claimed_date %]" [% END %] - +[% INCLUDE 'empty_line.inc' %] ,,Total orders in late, [% orders.size %] -- 2.39.5