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

(-)a/C4/Search.pm (-6 / +16 lines)
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
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-1 / +11 lines)
Lines 231-237 Link Here
231
<!-- AVAILABILITY LIMITS -->
231
<!-- AVAILABILITY LIMITS -->
232
    <fieldset id="availability"><legend>Location and availability</legend>
232
    <fieldset id="availability"><legend>Location and availability</legend>
233
<fieldset id="currently-avail">
233
<fieldset id="currently-avail">
234
        <p><label for="available-items">Only items currently available</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
234
        <p>
235
            <label for="available-items">Only items currently available for loan or reference</label>
236
            <input type="checkbox" id="available-items" name="limit" value="available" />
237
            <span class="hint">i.e. not checked out and not lost</span>
238
        </p>
239
</fieldset>
240
<fieldset id="for_loan">
241
        <p>
242
            <label for="for_loan-items">Only items that can be checked out</label>
243
            <input type="checkbox" id="for_loan-items" name="limit" value="for_loan" />
244
        </p>
235
</fieldset>
245
</fieldset>
236
246
237
<fieldset id="select-libs">
247
<fieldset id="select-libs">
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt (-2 / +10 lines)
Lines 304-310 Link Here
304
                [% END %]
304
                [% END %]
305
                </select>
305
                </select>
306
        [% END %]        
306
        [% END %]        
307
        <div style="margin-top:.4em"><label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label></div>
307
        <div style="margin-top:.4em">
308
            <label for="available-items">
309
                <input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference
310
            </label>
311
        </div>
312
        <div style="margin-top:.4em">
313
            <label for="for_loan-items">
314
                <input type="checkbox" id="for_loan-items" name="limit" value="for_loan" /> Only items that can be checked out
315
            </label>
316
        </div>
308
    </fieldset></div>
317
    </fieldset></div>
309
    [% END %]
318
    [% END %]
310
<!-- /AVAILABILITY LIMITS -->
319
<!-- /AVAILABILITY LIMITS -->
311
- 

Return to bug 10304