Bug 16653: Display number of checkouts when exporting 'Most-circulated items' as CSV

reports/cat_issues_top.pl does not export "Count of checkouts" column as CSV

To replicate:

1/ Make sure that test instance has circulation in a given date range
2/ Go to Home › Reports › Most-circulated items
3/ Select a date range
4/ Select 'To screen into the browser' radio button, click submit.
5/ Note that Columns 'Rank/Biblioitemnumbers', 'Global' and 'Count of checkouts' appear in screen output.
6/ Click the browser's back button
7/ Change output to 'To a file', click submit.

Without this patch:
the columns "100/", "Global" and "Total" are exported to the CSV file.
"100/" contains the rank, "Global" is still global, and the "Total" column is empty.

With this patch patch applied, the last column is filled and the "Total" line is removed

(This script is really dirty)

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>

(Yes it is)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5bb6b6581c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2018-06-07 11:47:46 -03:00 committed by Fridolin Somers
parent 3e0ccc346c
commit ad6b2e8dc1
1 changed files with 1 additions and 10 deletions

View File

@ -94,17 +94,10 @@ if ($do_it) {
print $line->{rowtitle}.$sep;
foreach my $cell (@$x) {
print $cell->{value}.$sep;
print $cell->{count};
}
print $line->{totalrow};
print "\n";
}
# footer
print "TOTAL";
$cols = @$results[0]->{loopfooter};
foreach my $col ( @$cols ) {
print $sep.$col->{totalcol};
}
print $sep.@$results[0]->{total};
exit;
}
# Displaying choices
@ -164,7 +157,6 @@ output_html_with_http_headers $input, $cookie, $template->output;
sub calculate {
my ($line, $column, $filters) = @_;
my @mainloop;
my @loopfooter;
my @loopcol;
my @loopline;
my @looprow;
@ -416,7 +408,6 @@ sub calculate {
$globalline{looprow} = \@looprow;
$globalline{loopcol} = \@loopcol;
# # the foot (totals by borrower type)
$globalline{loopfooter} = \@loopfooter;
$globalline{total}= $grantotal;
$globalline{line} = $line;
$globalline{column} = $column;