Lines 1234-1243
sub buildQuery {
Link Here
|
1234 |
$q =~ s| and \( \(allrecords,AlwaysMatches=''\) and \(not-onloan-count,st-numeric >= 1\) and \(lost,st-numeric=0\) \)||; |
1234 |
$q =~ s| and \( \(allrecords,AlwaysMatches=''\) and \(not-onloan-count,st-numeric >= 1\) and \(lost,st-numeric=0\) \)||; |
1235 |
$original_q = $q; |
1235 |
$original_q = $q; |
1236 |
} |
1236 |
} |
|
|
1237 |
unless ( grep { $_ eq 'withoutitems' } @limits ) { |
1238 |
$q =~ s| and \( allrecords,AlwaysMatches='' not\(homebranch,AlwaysMatches=''\) \)||; |
1239 |
$original_q = $q; |
1240 |
} |
1237 |
if ( @limits ) { |
1241 |
if ( @limits ) { |
1238 |
if ( grep { $_ eq 'available' } @limits ) { |
1242 |
if ( grep { $_ eq 'available' } @limits ) { |
1239 |
$q .= q| and ( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) )|; |
1243 |
$q .= q| and ( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) )|; |
1240 |
@limits = grep {!/^available$/} @limits; |
1244 |
@limits = grep { $_ ne 'available' } @limits; |
|
|
1245 |
} |
1246 |
if ( grep { $_ eq 'withoutitems' } @limits ) { |
1247 |
$q .= q| and ( allrecords,AlwaysMatches='' not(homebranch,AlwaysMatches='') )|; |
1248 |
@limits = grep { $_ ne 'withoutitems' } @limits; |
1241 |
} |
1249 |
} |
1242 |
$q .= ' and '.join(' and ', @limits) if @limits; |
1250 |
$q .= ' and '.join(' and ', @limits) if @limits; |
1243 |
} |
1251 |
} |
1244 |
- |
|
|