Bug 19671: Map itemtypes to hash for correct display in issues_stats.pl
To test: 1 - Run the circulation wizard with itemtypes as columns, shelving locations as rows - display on screen 2 - Note all itemtype values are blank 3 - Switch rows/columns - same issue 4 - Apply patch 5 - Re-run reports 6 - Itemtypes should display correctly Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
3c78966c5d
commit
47b359cc96
1 changed files with 5 additions and 5 deletions
|
@ -87,6 +87,8 @@ $sep = "\t" if ($sep eq 'tabulation');
|
|||
$template->param(do_it => $do_it,
|
||||
);
|
||||
|
||||
our $itemtypes = Koha::ItemTypes->search_with_localization->unblessed;
|
||||
|
||||
our @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']});
|
||||
|
||||
our $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) };
|
||||
|
@ -150,9 +152,6 @@ my @values;
|
|||
my %labels;
|
||||
my %select;
|
||||
|
||||
# create itemtype arrayref for <select>.
|
||||
our $itemtypes = Koha::ItemTypes->search_with_localization;
|
||||
|
||||
# location list
|
||||
my @locations;
|
||||
foreach (sort keys %$locations) {
|
||||
|
@ -354,12 +353,13 @@ sub calculate {
|
|||
$sth->execute;
|
||||
}
|
||||
|
||||
my $itemtypes_map = { map { $_->{itemtype} => $_ } @{ $itemtypes } };
|
||||
while ( my ($celvalue) = $sth->fetchrow ) {
|
||||
my %cell = ( rowtitle => $celvalue, totalrow => 0 ); # we leave 'rowtitle' as hash key (used when filling the table), and add coltitle_display
|
||||
$cell{rowtitle_display} =
|
||||
( $line =~ /ccode/ ) ? $ccodes->{$celvalue}
|
||||
: ( $line =~ /location/ ) ? $locations->{$celvalue}
|
||||
: ( $line =~ /itemtype/ ) ? $itemtypes->{$celvalue}->{description}
|
||||
: ( $line =~ /itemtype/ ) ? $itemtypes_map->{$celvalue}->{translated_description}
|
||||
: $celvalue; # default fallback
|
||||
if ( $line =~ /sort1/ ) {
|
||||
foreach (@$Bsort1) {
|
||||
|
@ -448,7 +448,7 @@ sub calculate {
|
|||
$cell{coltitle_display} =
|
||||
( $column =~ /ccode/ ) ? $ccodes->{$celvalue}
|
||||
: ( $column =~ /location/ ) ? $locations->{$celvalue}
|
||||
: ( $column =~ /itemtype/ ) ? $itemtypes->{$celvalue}->{description}
|
||||
: ( $column =~ /itemtype/ ) ? $itemtypes_map->{$celvalue}->{translated_description}
|
||||
: $celvalue; # default fallback
|
||||
if ( $column =~ /sort1/ ) {
|
||||
foreach (@$Bsort1) {
|
||||
|
|
Loading…
Reference in a new issue