foreach my $field (@fields) {
my $data = $field->as_string( $subfield_letters, $facet->{sep} );
- unless ( $data ~~ @used_datas ) {
+ unless ( grep { /^\Q$data\E$/ } @used_datas ) {
push @used_datas, $data;
$facets_counter->{ $facet->{idx} }->{$data}++;
}
my $item_in_transit_count = 0;
my $can_place_holds = 0;
my $item_onhold_count = 0;
+ my $notforloan_count = 0;
my $items_count = scalar(@fields);
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
# item is on order
if ( $item->{notforloan} < 0 ) {
$ordered_count++;
+ } elsif ( $item->{notforloan} > 0 ) {
+ $notforloan_count++;
}
# is item in transit?
}
# XSLT processing of some stuff
- use C4::Charset;
- SetUTF8Flag($marcrecord);
+ SetUTF8Flag($marcrecord);
warn $marcrecord->as_formatted if $DEBUG;
- my $interface = $search_context eq 'opac' ? 'OPAC' : '';
- if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) {
+ my $interface = $search_context eq 'opac' ? 'OPAC' : '';
+ if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) {
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems);
- # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs
+ # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs
}
# if biblio level itypes are used and itemtype is notforloan, it can't be reserved either
$oldbiblio->{intransitcount} = $item_in_transit_count;
$oldbiblio->{onholdcount} = $item_onhold_count;
$oldbiblio->{orderedcount} = $ordered_count;
+ $oldbiblio->{notforloancount} = $notforloan_count;
if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
my $fieldspec = C4::Context->preference("AlternateHoldingsField");