From 7c3deea5610a0a4a08af7b3a49718e0c4434ea45 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Wed, 11 Mar 2015 10:46:49 -0300 Subject: [PATCH] Bug 11668: another approach In this patch I pass the messages to be printed as hidden parameters that are set using JQuery, and translated in the usual way. To test: 1) Apply the patch 2) Update and install de-DE (works with this lang) 3) Go to Reports > Patron statistics 4) Select Patron category in row, Library as column (just an example), export as CSV 5) Switch to German and repeat 4 6) Check translated 'Total/TOTAL' in german CSV Just a idea, if you like it, can be extended to the other cases --- .../prog/en/modules/reports/borrowers_stats.tt | 15 +++++++++++++++ reports/borrowers_stats.pl | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt index 200ce24..09a72fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt @@ -11,6 +11,19 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] + +
@@ -283,6 +296,8 @@ + + [% END %] diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index 0280a86..ab3d6e2 100755 --- a/reports/borrowers_stats.pl +++ b/reports/borrowers_stats.pl @@ -64,6 +64,8 @@ my $basename = $input->param("basename"); our $sep = $input->param("sep"); $sep = "\t" if ($sep and $sep eq 'tabulation'); my $selected_branch; # = $input->param("?"); +my $ntotal = $input->param("ntotal"); +my $utotal = $input->param("utotal"); our $branches = GetBranches; @@ -96,7 +98,7 @@ if ($do_it) { foreach my $col ( @$cols ) { print $col->{coltitle}.$sep; } - print "Total\n"; + print "$ntotal\n"; foreach my $line ( @$lines ) { my $x = $line->{loopcell}; print $line->{rowtitle}.$sep; @@ -106,7 +108,7 @@ if ($do_it) { print $line->{totalrow}; print "\n"; } - print "TOTAL"; + print "$utotal"; $cols = @$results[0]->{loopfooter}; foreach my $col ( @$cols ) { print $sep.$col->{totalcol}; -- 1.7.9.5