$VERSION = 3.01;
$DEBUG = ($ENV{DEBUG}) ? 1 : 0;
}
-
+$DEBUG=1;
=head1 NAME
C4::Search - Functions for searching the Koha catalog.
foreach ( keys %{ C4::Context->stopwords } ) {
next if ( $_ =~ /(and|or|not)/ ); # don't remove operators
if ( $operand =~
- /(\P{IsAlpha}$_\P{IsAlpha}|^$_\P{IsAlpha}|\P{IsAlpha}$_$)/ )
+ /(\P{IsAlpha}$_\P{IsAlpha}|^$_\P{IsAlpha}|\P{IsAlpha}$_$|^$_$)/ )
{
$operand =~ s/\P{IsAlpha}$_\P{IsAlpha}/ /gi;
$operand =~ s/^$_\P{IsAlpha}/ /gi;
$operand =~ s/\P{IsAlpha}$_$/ /gi;
+ $operand =~ s/$1//gi;
push @stopwords_removed, $_;
}
}
$oldbiblio->{result_number} = $i + 1;
# add imageurl to itemtype if there is one
- if ( $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} =~ /^http:/ ) {
- $oldbiblio->{imageurl} =
- $itemtypes{ $oldbiblio->{itemtype} }->{imageurl};
- } else {
- $oldbiblio->{imageurl} =
- getitemtypeimagesrc() . "/"
- . $itemtypes{ $oldbiblio->{itemtype} }->{imageurl}
- if ( $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} );
- }
+ $oldbiblio->{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} );
+
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $oldbiblio->{biblionumber} ) );
$oldbiblio->{authorised_value_images} = $biblio_authorised_value_images;
- my $aisbn = $oldbiblio->{'isbn'};
- $aisbn =~ /(\d*[X]*)/;
- $oldbiblio->{amazonisbn} = $1;
+ (my $aisbn) = $oldbiblio->{isbn} =~ /([\d-]*[X]*)/;
+ $aisbn =~ s/-//g;
+ $oldbiblio->{amazonisbn} = $aisbn;
$oldbiblio->{description} = $itemtypes{ $oldbiblio->{itemtype} }->{description};
# Build summary if there is one (the summary is defined in the itemtypes table)
# FIXME: is this used anywhere, I think it can be commented out? -- JF
$onloan_items->{$key}->{branchname} = $item->{branchname};
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} };
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber};
- $onloan_items->{$key}->{imageurl} = getitemtypeimagesrc() . "/" . $itemtypes{ $item->{itype} }->{imageurl};
+ $onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes{ $item->{itype} }->{imageurl} );
# if something's checked out and lost, mark it as 'long overdue'
if ( $item->{itemlost} ) {
$onloan_items->{$prefix}->{longoverdue}++;
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value;
$other_items->{$key}->{count}++ if $item->{homebranch};
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} };
- $other_items->{$key}->{imageurl} = getitemtypeimagesrc() . "/" . $itemtypes{ $item->{itype} }->{imageurl};
+ $other_items->{$key}->{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes{ $item->{itype} }->{imageurl} );
}
# item is available
else {
$available_items->{$prefix}->{$_} = $item->{$_};
}
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };
- $available_items->{$prefix}->{imageurl} = getitemtypeimagesrc() . "/" . $itemtypes{ $item->{itype} }->{imageurl};
+ $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes{ $item->{itype} }->{imageurl} );
}
}
} # notforloan, item level and biblioitem level