|
Lines 1349-1354
sub _SearchItems_build_where_fragment {
Link Here
|
| 1349 |
} |
1349 |
} |
| 1350 |
$column = "ExtractValue($sqlfield, '$xpath')"; |
1350 |
$column = "ExtractValue($sqlfield, '$xpath')"; |
| 1351 |
} |
1351 |
} |
|
|
1352 |
} |
| 1353 |
elsif ($field eq 'isbn') { |
| 1354 |
if ( C4::Context->preference("SearchWithISBNVariations") and $query ) { |
| 1355 |
my @isbns = C4::Koha::GetVariationsOfISBN( $query ); |
| 1356 |
$query = []; |
| 1357 |
push @$query, @isbns; |
| 1358 |
} |
| 1359 |
$column = $field; |
| 1360 |
} |
| 1361 |
elsif ($field eq 'issn') { |
| 1362 |
if ( C4::Context->preference("SearchWithISSNVariations") and $query ) { |
| 1363 |
my @issns = C4::Koha::GetVariationsOfISSN( $query ); |
| 1364 |
$query = []; |
| 1365 |
push @$query, @issns; |
| 1366 |
} |
| 1367 |
$column = $field; |
| 1352 |
} else { |
1368 |
} else { |
| 1353 |
$column = $field; |
1369 |
$column = $field; |
| 1354 |
} |
1370 |
} |
|
Lines 1358-1372
sub _SearchItems_build_where_fragment {
Link Here
|
| 1358 |
} |
1374 |
} |
| 1359 |
|
1375 |
|
| 1360 |
if (ref $query eq 'ARRAY') { |
1376 |
if (ref $query eq 'ARRAY') { |
| 1361 |
if ($op eq '=') { |
1377 |
if ($op eq 'like') { |
| 1362 |
$op = 'IN'; |
1378 |
$where_fragment = { |
| 1363 |
} elsif ($op eq '!=') { |
1379 |
str => "($column LIKE " . join (" OR $column LIKE ", ('?') x @$query ) . ")", |
| 1364 |
$op = 'NOT IN'; |
1380 |
args => $query, |
|
|
1381 |
}; |
| 1382 |
} |
| 1383 |
else { |
| 1384 |
if ($op eq '=') { |
| 1385 |
$op = 'IN'; |
| 1386 |
} elsif ($op eq '!=') { |
| 1387 |
$op = 'NOT IN'; |
| 1388 |
} |
| 1389 |
$where_fragment = { |
| 1390 |
str => "$column $op (" . join (',', ('?') x @$query) . ")", |
| 1391 |
args => $query, |
| 1392 |
}; |
| 1365 |
} |
1393 |
} |
| 1366 |
$where_fragment = { |
|
|
| 1367 |
str => "$column $op (" . join (',', ('?') x @$query) . ")", |
| 1368 |
args => $query, |
| 1369 |
}; |
| 1370 |
} elsif ( $op eq 'is' ) { |
1394 |
} elsif ( $op eq 'is' ) { |
| 1371 |
$where_fragment = { |
1395 |
$where_fragment = { |
| 1372 |
str => "$column $op $query", |
1396 |
str => "$column $op $query", |
| 1373 |
- |
|
|