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

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

Return to bug 26860