From fdb3fe977cf19ad030d555e339e06cd959f76310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Tue, 30 May 2017 08:41:53 +0200 Subject: [PATCH] Bug 18694: Translatability: Get rid of exposing [%% FOREACH in csv/cash_register_stats.tt Code exposed is: %s %s %s [%%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %%] %s TOTAL [%%- FOREACH field IN total; field; sep IF !loop.last; END %%] To test: - Apply patch - In staff client, verify that Cash register statistics work as before (Home > Reports > Cash register statistics) - Bonus test: Create a "language" aa-AA (perl translate create aa-AA from folder misc/translator, verify that lines mentioned above do no longer appear in aa-AA-staff-prog.po - Run QA tools (newest version with test for newlines in tt directives) --- .../prog/en/modules/reports/csv/cash_register_stats.tt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt index fc0b217..88f8685 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt @@ -1,14 +1,7 @@ [% USE ItemTypes %] [% INCLUDE csv_headers/reports/cash_register_stats.tt %] -[%- FOREACH row IN rows %] - [%- FOREACH field IN row; - field IF !loop.last; - ItemTypes.GetDescription(field) IF loop.last; - sep IF !loop.last; - END %] +[%- FOREACH row IN rows # Avoid line breaks in directives because of translatability%] + [%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %] [% END -%] TOTAL -[%- FOREACH field IN total; - field; - sep IF !loop.last; -END %] +[%- FOREACH field IN total; field; sep IF !loop.last; END %] -- 2.1.4