Bug 32588: Make filters on 'items with no checkouts' report translatable

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 <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-01-07 02:11:48 +00:00 committed by Tomas Cohen Arazi
parent 2d724ae68e
commit 74f2b83255
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 30 additions and 19 deletions

View File

@ -40,24 +40,35 @@
[% FOREACH mainloo IN mainloop %]
[% IF ( mainloo.loopfilter ) %]
<p>Filtered on:</p>
[% FOREACH loopfilte IN mainloo.loopfilter %]
[% IF ( loopfilte.err ) %]
<p class="error">Error:
[% ELSE %]
<p>
[% END %]
[% IF ( loopfilte.sql ) %]
<span class="sql">
[% loopfilte.crit | html %] = [% loopfilte.filter | html %]
</span>
[% ELSE %]
<span>[% loopfilte.crit | html %] = [% loopfilte.filter | html %]</span>
[% IF ( loopfilte.crit == "by" ) %]
[% group_by = loopfilte.filter %]
<ul>
[% FOREACH loopfilte IN mainloo.loopfilter %]
[% IF ( loopfilte.err ) %]
<p class="error">Error: [% loopfilte.filter | html %]</p>
[% ELSIF ( loopfilte.sql ) %]
<span class="sql">
[% loopfilte.crit | html %] = [% loopfilte.filter | html %]
</span>
[% ELSE %]
[% SWITCH loopfilte.crit %]
[% CASE 'homelibrary' %]<li>Home library: [% Branches.GetName( loopfilte.filter ) | html %]</li>
[% CASE 'itemtype' %]<li>Item type: [% ItemTypes.GetDescription( loopfilte.filter ) | html %]</li>
[% CASE 'limit' %]<li>Limit: [% loopfilte.filter | html %]</li>
[% CASE 'by' %]
<li>By:
[% group_by = loopfilte.filter %]
[% IF ( group_by == "homebranch") %]
Home library
[% ELSIF ( group_by == "itype" ) %]
Item type
[% ELSE %]
None
[% END %]
</li>
[% CASE %]<li>[% loopfilte.crit %]: [% loopfilte.filter | html %]</li>
[% END %]
[% END %]
[% END %]
</p>
[% END %]
</ul>
[% END %]
[% IF ( mainloo.looptables ) %]
@ -78,7 +89,7 @@
[% ELSIF ( group_by=="homebranch" ) %]
<a href="#table[% looptable.coltitle | uri %]">[% Branches.GetName( looptable.coltitle ) | html %]</a>
[% ELSE %]
<a href="#table[% looptable.coltitle | uri %]">[% looptable.coltitle | html %]</a>
<a href="#table[% looptable.coltitle | uri %]">Ungrouped</a>
[% END %]
</td>
<td>

View File

@ -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;
}
}