X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FXISBN.pm;h=55126334b3c9c997c997126edb3b40d6ba07643e;hb=c80cd97b68c76312062780783427542a5268c61f;hp=cbb24845c723a5478f1b54ffcec1fa1e4ba9a458;hpb=b0941f9058fa96818fceaf2515742ab0f4bebbe1;p=koha.git diff --git a/C4/XISBN.pm b/C4/XISBN.pm index cbb24845c7..55126334b3 100644 --- a/C4/XISBN.pm +++ b/C4/XISBN.pm @@ -4,18 +4,18 @@ package C4::XISBN; # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . use XML::Simple; #use LWP::Simple; @@ -26,13 +26,15 @@ use C4::External::Syndetics qw(get_syndetics_editions); use LWP::UserAgent; use HTTP::Request::Common; +use Koha::SearchEngine; +use Koha::SearchEngine::Search; + use strict; #use warnings; FIXME - Bug 2505 -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); BEGIN { require Exporter; - $VERSION = 3.07.00.049; @ISA = qw(Exporter); @EXPORT_OK = qw( &get_xisbns @@ -64,10 +66,11 @@ sub _get_biblio_from_xisbn { my $xisbn = shift; my $dbh = C4::Context->dbh; - my ( $errors, $results, $total_hits ) = C4::Search::SimpleSearch( "nb=$xisbn", 0, 1 ); + my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); + my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat( "nb=$xisbn", 0, 1 ); return unless ( !$errors && scalar @$results ); - my $record = MARC::Record::new_from_usmarc( $results->[0] ); + my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[0] ); my $biblionumber = C4::Biblio::get_koha_field_from_marc('biblio', 'biblionumber', $record, ''); return unless $biblionumber;