Lines 1517-1533
sub buildQuery {
Link Here
|
1517 |
# add limits |
1517 |
# add limits |
1518 |
my %group_OR_limits; |
1518 |
my %group_OR_limits; |
1519 |
my $availability_limit; |
1519 |
my $availability_limit; |
|
|
1520 |
my $for_loan_limit; |
1520 |
foreach my $this_limit (@limits) { |
1521 |
foreach my $this_limit (@limits) { |
1521 |
next unless $this_limit; |
1522 |
next unless $this_limit; |
1522 |
if ( $this_limit =~ /available/ ) { |
1523 |
if ( $this_limit =~ /available/ ) { |
1523 |
# |
1524 |
|
1524 |
## 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) |
1525 |
# 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) |
1525 |
## In English: |
1526 |
# In English: |
1526 |
## all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 |
1527 |
# all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 |
1527 |
$availability_limit .= |
1528 |
$availability_limit .= |
1528 |
"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; |
1529 |
"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; |
1529 |
$limit_cgi .= "&limit=available"; |
1530 |
$limit_cgi .= "&limit=available"; |
1530 |
$limit_desc .= ""; |
1531 |
} |
|
|
1532 |
|
1533 |
if ( $this_limit =~ /for_loan/ ) { |
1534 |
|
1535 |
$for_loan_limit .= "( notforloan,st-numeric = 0 )"; |
1536 |
$limit_cgi .= "&limit=for_loan"; |
1531 |
} |
1537 |
} |
1532 |
|
1538 |
|
1533 |
# group_OR_limits, prefixed by mc- |
1539 |
# group_OR_limits, prefixed by mc- |
Lines 1573-1578
sub buildQuery {
Link Here
|
1573 |
$limit .= " and " if ( $query || $limit ); |
1579 |
$limit .= " and " if ( $query || $limit ); |
1574 |
$limit .= "($availability_limit)"; |
1580 |
$limit .= "($availability_limit)"; |
1575 |
} |
1581 |
} |
|
|
1582 |
if ( $for_loan_limit ) { |
1583 |
$limit .= " and " if ( $query || $limit ); |
1584 |
$limit .= $for_loan_limit; |
1585 |
} |
1576 |
|
1586 |
|
1577 |
# Normalize the query and limit strings |
1587 |
# Normalize the query and limit strings |
1578 |
# This is flawed , means we can't search anything with : in it |
1588 |
# This is flawed , means we can't search anything with : in it |