Bugzilla – Attachment 18350 Details for
Bug 10304
Add avanced search filter for "not for loan" items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10304 - Add avanced search filter for "not for loan" items
Bug-10304---Add-avanced-search-filter-for-not-for-.patch (text/plain), 5.36 KB, created by
Kyle M Hall (khall)
on 2013-05-23 14:09:39 UTC
(
hide
)
Description:
Bug 10304 - Add avanced search filter for "not for loan" items
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-23 14:09:39 UTC
Size:
5.36 KB
patch
obsolete
>From f22e5834f980f660b63c597727e3175288e66e49 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 23 May 2013 10:01:21 -0400 >Subject: [PATCH] Bug 10304 - Add avanced search filter for "not for loan" items > >This patch adds a new search limit for not for loan items. This limit >filters all items that have a notforloan value not equal to 0. This >limit can be used in conjunction with the "available" limit so that >a person may search for items that are available and can be checked out >right away. > >Test Plan: >1) Apply this patch >2) Catalog 3 records with 1 item each. > a) Mark item A as notforloan > b) Mark item B as lost > c) Do nothing to item C >3) Do a search limiting only to available items > a) You should see item's A and C in your reults >4) Do a search limiting only to items that can be checked out > a) You should see item's B and C >5) Do a seach using both limits > a) You should see item C and not items A or B >--- > C4/Search.pm | 22 ++++++++++++++----- > .../prog/en/modules/catalogue/advsearch.tt | 12 ++++++++++- > .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 11 +++++++++- > 3 files changed, 37 insertions(+), 8 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index aec024b..9e60f29 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1517,17 +1517,23 @@ sub buildQuery { > # add limits > my %group_OR_limits; > my $availability_limit; >+ my $for_loan_limit; > foreach my $this_limit (@limits) { > next unless $this_limit; > if ( $this_limit =~ /available/ ) { >-# >-## 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) >-## In English: >-## all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 >+ >+ # 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) >+ # In English: >+ # all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 > $availability_limit .= >-"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; >+ "( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; > $limit_cgi .= "&limit=available"; >- $limit_desc .= ""; >+ } >+ >+ if ( $this_limit =~ /for_loan/ ) { >+ >+ $for_loan_limit .= "( notforloan,st-numeric = 0 )"; >+ $limit_cgi .= "&limit=for_loan"; > } > > # group_OR_limits, prefixed by mc- >@@ -1573,6 +1579,10 @@ sub buildQuery { > $limit .= " and " if ( $query || $limit ); > $limit .= "($availability_limit)"; > } >+ if ( $for_loan_limit ) { >+ $limit .= " and " if ( $query || $limit ); >+ $limit .= $for_loan_limit; >+ } > > # Normalize the query and limit strings > # This is flawed , means we can't search anything with : in it >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index c982eb4..975560e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -231,7 +231,17 @@ > <!-- AVAILABILITY LIMITS --> > <fieldset id="availability"><legend>Location and availability</legend> > <fieldset id="currently-avail"> >- <p><label for="available-items">Only items currently available</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p> >+ <p> >+ <label for="available-items">Only items currently available for loan or reference</label> >+ <input type="checkbox" id="available-items" name="limit" value="available" /> >+ <span class="hint">i.e. not checked out and not lost</span> >+ </p> >+</fieldset> >+<fieldset id="for_loan"> >+ <p> >+ <label for="for_loan-items">Only items that can be checked out</label> >+ <input type="checkbox" id="for_loan-items" name="limit" value="for_loan" /> >+ </p> > </fieldset> > > <fieldset id="select-libs"> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >index 825e8be..f2591bc 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >@@ -304,7 +304,16 @@ > [% END %] > </select> > [% END %] >- <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> >+ <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> >+ <div style="margin-top:.4em"> >+ <label for="for_loan-items"> >+ <input type="checkbox" id="for_loan-items" name="limit" value="for_loan" /> Only items that can be checked out >+ </label> >+ </div> > </fieldset></div> > [% END %] > <!-- /AVAILABILITY LIMITS --> >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10304
:
18280
| 18350