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

(-)a/cataloguing/addbooks.pl (-13 / +5 lines)
Lines 38-43 use Koha::BiblioFrameworks; Link Here
38
use Koha::SearchEngine::Search;
38
use Koha::SearchEngine::Search;
39
use Koha::SearchEngine::QueryBuilder;
39
use Koha::SearchEngine::QueryBuilder;
40
use Koha::Z3950Servers;
40
use Koha::Z3950Servers;
41
use Business::ISBN;
41
42
42
my $input = CGI->new;
43
my $input = CGI->new;
43
44
Lines 105-123 if ($query) { Link Here
105
my $countbr = 0;
106
my $countbr = 0;
106
my @resultsbr;
107
my @resultsbr;
107
if ($query) {
108
if ($query) {
108
# fill isbn or title, depending on what has been entered
109
#u must do check on isbn because u can find number in beginning of title
110
#check is on isbn legnth 13 for new isbn and 10 for old isbn
111
    my ( $title, $isbn );
109
    my ( $title, $isbn );
112
    if ($query=~/\d/) {
110
    my $isbn_valid = Business::ISBN->new($query);
113
        my $clean_query = $query;
111
    if ( $isbn_valid && $isbn_valid->is_valid() ) {
114
        $clean_query =~ s/-//g; # remove hyphens
112
        $isbn = $query;
115
        my $querylength = length $clean_query;
113
    } else {
116
        if ( $querylength == 13 || $querylength == 10 ) {
117
            $isbn = $query;
118
        }
119
    }
120
    if (!$isbn) {
121
        $title = $query;
114
        $title = $query;
122
    }
115
    }
123
    ( $countbr, @resultsbr ) = BreedingSearch( $title, $isbn );
116
    ( $countbr, @resultsbr ) = BreedingSearch( $title, $isbn );
124
- 

Return to bug 29319