Lines 571-590
sub getRecords {
Link Here
|
571 |
} |
571 |
} |
572 |
} |
572 |
} |
573 |
|
573 |
|
574 |
# also, if it's a location code, use the name instead of the code |
574 |
my $av; |
|
|
575 |
# also, if it's a location code, use the name instead of the code |
575 |
if ( $link_value =~ /location/ ) { |
576 |
if ( $link_value =~ /location/ ) { |
576 |
# TODO Retrieve all authorised values at once, instead of 1 query per entry |
577 |
# TODO Retrieve all authorised values at once, instead of 1 query per entry |
577 |
my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $one_facet }); |
578 |
$av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $one_facet }); |
578 |
$facet_label_value = $av->count ? $av->next->opac_description : ''; |
|
|
579 |
} |
579 |
} |
580 |
|
580 |
|
581 |
# also, if it's a collection code, use the name instead of the code |
581 |
# also, if it's a collection code, use the name instead of the code |
582 |
if ( $link_value =~ /ccode/ ) { |
582 |
if ( $link_value =~ /ccode/ ) { |
583 |
# TODO Retrieve all authorised values at once, instead of 1 query per entry |
583 |
# TODO Retrieve all authorised values at once, instead of 1 query per entry |
584 |
my $av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $one_facet }); |
584 |
$av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $one_facet }); |
585 |
$facet_label_value = $av->count ? $av->next->opac_description : ''; |
|
|
586 |
} |
585 |
} |
587 |
|
586 |
|
|
|
587 |
if ($opac) { |
588 |
$facet_label_value = $av->next->opac_description if $av && $av->count; |
589 |
} else { |
590 |
$av = $av->next if $av && $av->count; |
591 |
if ($av) { |
592 |
my $lib = $av->lib; |
593 |
$facet_label_value = $lib ? $lib : $av->lib_opac; |
594 |
} |
595 |
} |
596 |
|
597 |
$facet_label_value ||= ''; |
598 |
|
588 |
# but we're down with the whole label being in the link's title. |
599 |
# but we're down with the whole label being in the link's title. |
589 |
push @this_facets_array, |
600 |
push @this_facets_array, |
590 |
{ |
601 |
{ |