Bug 12587 - Improve output of filter information on patrons with the most checkouts report

This patch makes some changes to the way filter information is displayed
after running the patrons with the most checkouts report. Before this
patch several untranslatable English strings would be displayed, and
library and item type codes would be shown instead of descriptions.

To test, go to Reports -> Patrons checking out the most. Enter values
for all the filter options:

- Checkout date from
- Checkout date to
- Checkin date from
- Checkin date to
- Library
- Item type
- Patron category

When you submit the form and view the results you should see your date
submissions formatted according to your selected dateformat system
preference. The library name and item type names should be shown instead
of codes.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Improves translatability of the filters output after running
the report and the readability of them (removing codes).

Note: it would be nice if the read-only would be removed from the date
fields, as forcing people to use the date widget is a known accessibility
issue.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Owen Leonard 2014-07-16 11:23:00 -04:00 committed by Tomas Cohen Arazi
parent c8016e0a0c
commit bfb20c9a7e
2 changed files with 38 additions and 6 deletions

View File

@ -1,3 +1,6 @@
[% USE Branches %]
[% USE KohaDates %]
[% USE ItemTypes %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Reports &rsaquo; Patrons with the most checkouts</title>
[% INCLUDE 'doc-head-close.inc' %]
@ -57,12 +60,41 @@ function Dopop(link) {
[% FOREACH mainloo IN mainloop %]
<h1>Top [% mainloo.limit %] List patrons for checkouts</h1>
<h1>Patrons with the most checkouts</h1>
[% IF ( mainloo.loopfilter ) %]
<p>Filtered on:</p>
[% FOREACH loopfilte IN mainloo.loopfilter %]
<p>[% IF ( loopfilte.err ) %] [% END %] [% loopfilte.crit %] =[% loopfilte.filter %][% IF ( loopfilte.err ) %] [% END %]</p>
[% END %]
[% IF mainloo.loopfilter.size %]
<p>Filtered on:</p>
<ul>
[% FOREACH loopfilte IN mainloo.loopfilter %]
<li>
[% SWITCH loopfilte.crit -%]
[% CASE "Issue From" -%]
Checked out after [% loopfilte.filter | $KohaDates %]
[% CASE "Issue To" -%]
Checked out before [% loopfilte.filter | $KohaDates %]
[% CASE "Return From" -%]
Checked in after [% loopfilte.filter | $KohaDates %]
[% CASE "Return To" -%]
Checked in before [% loopfilte.filter | $KohaDates %]
[% CASE "Branch" -%]
Library is [% Branches.GetName( loopfilte.filter ) %]
[% CASE "Doc Type" -%]
Item type is [% ItemTypes.GetDescription( loopfilte.filter ) %]
[% CASE "Bor Cat" -%]
Patron category code is [% loopfilte.filter %]
[% CASE "Day" -%]
Day is [% loopfilte.filter %]
[% CASE "Month" -%]
Month is [% loopfilte.filter %]
[% CASE "Year" -%]
Year is [% loopfilte.filter %]
[% CASE # default case -%]
[% loopfilte.crit %] = [% loopfilte.filter %]
[% END -%]
</li>
[% END %]
</ul>
[% END %]
[% END %]
<table>

View File

@ -181,7 +181,7 @@ sub calculate {
$cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ;
}
# format the dates filters, otherwise just fill as is
$cell{filter} .= ($i>=4) ? @$filters[$i] : format_date(@$filters[$i]);
$cell{filter} .= @$filters[$i];
defined ($cellmap[$i]) and
$cell{crit} .= $cellmap[$i];
push @loopfilter, \%cell;