$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'] } ) };
my %labels;
my %select;
-# create itemtype arrayref for <select>.
-our $itemtypes = Koha::ItemTypes->search_with_localization;
-
# location list
my @locations;
foreach (sort keys %$locations) {
$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) {
$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) {