From 87ab3871e2112103b08274720649498cfbd1d240 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sat, 7 Jan 2023 02:11:48 +0000 Subject: [PATCH] Bug 32588: Make filters on 'items with no checkouts' report translatable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the filters on top of the 'items with no checkouts' report translatable. The descriptions of the filters used the wrong terms and were also pulled from the .pl file, making them untranslatable. To test: * Without patch: Run the 'items with no checkouts' report with various settigs. * Verify, that the display on top doesn't use standard terminology Doc type = item type, Branch = library * Apply patch * Verify display is improved and standard terminology is used If you know how to, you can also confirm strings show up nicely in translations: https://wiki.koha-community.org/wiki/Translating_Koha#Updating_the_po_files_in_your_installation Signed-off-by: Frédéric Demians Signed-off-by: Martin Renvoize --- .../prog/en/modules/reports/catalogue_out.tt | 45 ++++++++++++------- reports/catalogue_out.pl | 4 +- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt index 73060fdb0c2..cc4262d7d6e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt @@ -40,24 +40,35 @@ [% FOREACH mainloo IN mainloop %] [% IF ( mainloo.loopfilter ) %]

Filtered on:

- [% FOREACH loopfilte IN mainloo.loopfilter %] - [% IF ( loopfilte.err ) %] -

Error: - [% ELSE %] -

- [% END %] - [% IF ( loopfilte.sql ) %] - - [% loopfilte.crit | html %] = [% loopfilte.filter | html %] - - [% ELSE %] - [% loopfilte.crit | html %] = [% loopfilte.filter | html %] - [% IF ( loopfilte.crit == "by" ) %] - [% group_by = loopfilte.filter %] +

    + [% FOREACH loopfilte IN mainloo.loopfilter %] + [% IF ( loopfilte.err ) %] +

    Error: [% loopfilte.filter | html %]

    + [% ELSIF ( loopfilte.sql ) %] + + [% loopfilte.crit | html %] = [% loopfilte.filter | html %] + + [% ELSE %] + [% SWITCH loopfilte.crit %] + [% CASE 'homelibrary' %]
  • Home library: [% Branches.GetName( loopfilte.filter ) | html %]
  • + [% CASE 'itemtype' %]
  • Item type: [% ItemTypes.GetDescription( loopfilte.filter ) | html %]
  • + [% CASE 'limit' %]
  • Limit: [% loopfilte.filter | html %]
  • + [% CASE 'by' %] +
  • By: + [% group_by = loopfilte.filter %] + [% IF ( group_by == "homebranch") %] + Home library + [% ELSIF ( group_by == "itype" ) %] + Item type + [% ELSE %] + None + [% END %] +
  • + [% CASE %]
  • [% loopfilte.crit %]: [% loopfilte.filter | html %]
  • + [% END %] [% END %] [% END %] -

    - [% END %] +
[% END %] [% IF ( mainloo.looptables ) %] @@ -78,7 +89,7 @@ [% ELSIF ( group_by=="homebranch" ) %] [% Branches.GetName( looptable.coltitle ) | html %] [% ELSE %] - [% looptable.coltitle | html %] + Ungrouped [% END %] diff --git a/reports/catalogue_out.pl b/reports/catalogue_out.pl index 51961790a86..c03dcb2d803 100755 --- a/reports/catalogue_out.pl +++ b/reports/catalogue_out.pl @@ -76,8 +76,8 @@ sub calculate { if ( ( $i == 1 ) and ( @$filters[ $i - 1 ] ) ) { $cell{err} = 1 if ( @$filters[$i] < @$filters[ $i - 1 ] ); } - $cell{crit} = "Branch" if ( $i == 0 ); - $cell{crit} = "Doc Type" if ( $i == 1 ); + $cell{crit} = "homelibrary" if ( $i == 0 ); + $cell{crit} = "itemtype" if ( $i == 1 ); push @loopfilter, \%cell; } } -- 2.39.1