View | Details | Raw Unified | Return to bug 20321
Collapse All | Expand All

(-)a/C4/XISBN.pm (-11 lines)
Lines 39-58 BEGIN { Link Here
39
	@ISA = qw(Exporter);
39
	@ISA = qw(Exporter);
40
	@EXPORT_OK = qw(
40
	@EXPORT_OK = qw(
41
		&get_xisbns
41
		&get_xisbns
42
        &get_biblionumber_from_isbn
43
	);
42
	);
44
}
43
}
45
44
46
sub get_biblionumber_from_isbn {
47
    my $isbn = shift;
48
   	$isbn.='%';
49
    my @biblionumbers;
50
    my $dbh=C4::Context->dbh;
51
    my $query = "SELECT biblionumber FROM biblioitems WHERE isbn LIKE ? LIMIT 10";
52
    my $sth = $dbh->prepare($query);
53
    $sth->execute($isbn);
54
	return $sth->fetchall_arrayref({});
55
}
56
=head1 NAME
45
=head1 NAME
57
46
58
C4::XISBN - Functions for retrieving XISBN content in Koha
47
C4::XISBN - Functions for retrieving XISBN content in Koha
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 30-36 use C4::Items; Link Here
30
use C4::Circulation;
30
use C4::Circulation;
31
use C4::Reserves;
31
use C4::Reserves;
32
use C4::Serials;
32
use C4::Serials;
33
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
33
use C4::XISBN qw(get_xisbns);
34
use C4::External::Amazon;
34
use C4::External::Amazon;
35
use C4::Search;		# enabled_staff_search_views
35
use C4::Search;		# enabled_staff_search_views
36
use C4::Tags qw(get_tags);
36
use C4::Tags qw(get_tags);
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 32-38 use C4::Biblio; Link Here
32
use C4::Items;
32
use C4::Items;
33
use C4::Circulation;
33
use C4::Circulation;
34
use C4::Tags qw(get_tags);
34
use C4::Tags qw(get_tags);
35
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
35
use C4::XISBN qw(get_xisbns);
36
use C4::External::Amazon;
36
use C4::External::Amazon;
37
use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes );
37
use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes );
38
use C4::Members;
38
use C4::Members;
(-)a/t/db_dependent/XISBN.t (-8 / +2 lines)
Lines 5-11 Link Here
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
7
8
use Test::More tests => 5;
8
use Test::More tests => 4;
9
use MARC::Record;
9
use MARC::Record;
10
use C4::Biblio;
10
use C4::Biblio;
11
use C4::XISBN;
11
use C4::XISBN;
Lines 45-56 my $biblionumber1 = _add_biblio_with_isbn($isbn1); Link Here
45
my $biblionumber2 = _add_biblio_with_isbn($isbn2);
45
my $biblionumber2 = _add_biblio_with_isbn($isbn2);
46
my $biblionumber3 = _add_biblio_with_isbn($isbn3);
46
my $biblionumber3 = _add_biblio_with_isbn($isbn3);
47
47
48
my $trial = C4::XISBN::get_biblionumber_from_isbn($isbn1);
48
my $trial = C4::XISBN::_get_biblio_from_xisbn($isbn1);
49
is( $trial->[0]->{biblionumber},
50
    $biblionumber1,
51
    "It gets the correct biblionumber from the only isbn we have added." );
52
53
$trial = C4::XISBN::_get_biblio_from_xisbn($isbn1);
54
is( $trial->{biblionumber},
49
is( $trial->{biblionumber},
55
    $biblionumber1, "Gets biblionumber like the previous test." );
50
    $biblionumber1, "Gets biblionumber like the previous test." );
56
51
57
- 

Return to bug 20321