adding famfamfam iconset, improving isbn for amazon content, etc.
[koha_gimpoz] / C4 / XISBN.pm
index dd2bd5d..1a177c1 100644 (file)
@@ -41,6 +41,8 @@ BEGIN {
 
 sub get_biblionumber_from_isbn {
     my $isbn = shift;
+    $isbn =~ /(\d*[X]*)/;
+    $isbn = $1;
     my @biblionumbers;
     my $dbh=C4::Context->dbh;
     my $query = "SELECT biblionumber FROM biblioitems WHERE isbn=?";
@@ -71,6 +73,8 @@ sub get_biblio_from_xisbn {
     my $xbiblio;
     if ($xbib_data->{biblionumber}) {
         $xbiblio = GetBiblioData($xbib_data->{biblionumber});
+        $xbiblio->{isbn} =~ /(\d*[X]*)/;
+        $xbiblio->{amazonisbn} = $1;
         $xbiblio->{items} = GetItemsByBiblioitemnumber($xbib_data->{biblionumber});
     }
     return ($xbiblio);
@@ -115,6 +119,8 @@ sub get_xisbns {
 
     # loop through each ISBN and scope to the local collection
     for my $response_data( @{ $response->{ isbn } } ) {
+        next if $response_data->{'content'} eq $isbn;
+        next if $isbn eq $response_data;
         next if $unique_xisbns->{ $response_data->{content} };
         $unique_xisbns->{ $response_data->{content} }++;
         my $xbiblio= get_biblio_from_xisbn($response_data->{content});