Lines 399-406
sub _convert_facets {
Link Here
|
399 |
|
399 |
|
400 |
# We also have some special cases, e.g. itypes that need to show the |
400 |
# We also have some special cases, e.g. itypes that need to show the |
401 |
# value rather than the code. |
401 |
# value rather than the code. |
402 |
my $itypes = Koha::ItemTypes->new(); |
402 |
my @itypes = Koha::ItemTypes->search; |
403 |
my %special = ( itype => sub { $itypes->get_description_for_code(@_) }, ); |
403 |
my %special = ( |
|
|
404 |
itype => { map { $_->itemtype => $_->description } @itypes }, |
405 |
); |
404 |
my @res; |
406 |
my @res; |
405 |
$exp_facet //= ''; |
407 |
$exp_facet //= ''; |
406 |
while ( ( $type, $data ) = each %$es ) { |
408 |
while ( ( $type, $data ) = each %$es ) { |
Lines 421-427
sub _convert_facets {
Link Here
|
421 |
my $t = $term->{term}; |
423 |
my $t = $term->{term}; |
422 |
my $c = $term->{count}; |
424 |
my $c = $term->{count}; |
423 |
if ( exists( $special{$type} ) ) { |
425 |
if ( exists( $special{$type} ) ) { |
424 |
$label = $special{$type}->($t); |
426 |
$label = $special{$type}->{$t} // $t; |
425 |
} |
427 |
} |
426 |
else { |
428 |
else { |
427 |
$label = $t; |
429 |
$label = $t; |
428 |
- |
|
|