|
Lines 1345-1350
sub _SearchItems_build_where_fragment {
Link Here
|
| 1345 |
} |
1345 |
} |
| 1346 |
$column = "ExtractValue($sqlfield, '$xpath')"; |
1346 |
$column = "ExtractValue($sqlfield, '$xpath')"; |
| 1347 |
} |
1347 |
} |
|
|
1348 |
} |
| 1349 |
elsif ($field eq 'isbn') { |
| 1350 |
if ( C4::Context->preference("SearchWithISBNVariations") ) { |
| 1351 |
my @isbns = C4::Koha::GetVariationsOfISBN( $query ); |
| 1352 |
$query = []; |
| 1353 |
foreach my $isb (@isbns){ |
| 1354 |
push @$query, "%$isb%"; |
| 1355 |
} |
| 1356 |
} |
| 1357 |
$column = $field; |
| 1358 |
} |
| 1359 |
elsif ($field eq 'issn') { |
| 1360 |
if ( C4::Context->preference("SearchWithISSNVariations") ) { |
| 1361 |
my @issns = C4::Koha::GetVariationsOfISSN( $query ); |
| 1362 |
$query = []; |
| 1363 |
foreach my $isn (@issns){ |
| 1364 |
push @$query, "%$isn%"; |
| 1365 |
} |
| 1366 |
} |
| 1367 |
$column = $field; |
| 1348 |
} else { |
1368 |
} else { |
| 1349 |
$column = $field; |
1369 |
$column = $field; |
| 1350 |
} |
1370 |
} |
|
Lines 1354-1368
sub _SearchItems_build_where_fragment {
Link Here
|
| 1354 |
} |
1374 |
} |
| 1355 |
|
1375 |
|
| 1356 |
if (ref $query eq 'ARRAY') { |
1376 |
if (ref $query eq 'ARRAY') { |
| 1357 |
if ($op eq '=') { |
1377 |
if ($op eq 'like') { |
| 1358 |
$op = 'IN'; |
1378 |
$where_fragment = { |
| 1359 |
} elsif ($op eq '!=') { |
1379 |
str => "($column LIKE " . join (" OR $column LIKE ", ('?') x @$query ) . ")", |
| 1360 |
$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 |
}; |
| 1361 |
} |
1393 |
} |
| 1362 |
$where_fragment = { |
|
|
| 1363 |
str => "$column $op (" . join (',', ('?') x @$query) . ")", |
| 1364 |
args => $query, |
| 1365 |
}; |
| 1366 |
} elsif ( $op eq 'is' ) { |
1394 |
} elsif ( $op eq 'is' ) { |
| 1367 |
$where_fragment = { |
1395 |
$where_fragment = { |
| 1368 |
str => "$column $op $query", |
1396 |
str => "$column $op $query", |
| 1369 |
- |
|
|