Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt
Vitor FERNANDES 6dcd8f235f Bug 9395: Problem with callnumber and standard number searches
This problem happens because there isn't a operator "phr" in the values
of callnumber and standard number search. So many results aren't the
corrects ones.

Test plan:

- Apply the patch
- In the dropbox search menu of OPAC main page header, the callnum
  should have only callnum
- In OPAC advanced search the callnumber and standard number options
  shouldn't have "phr"
- In staff client advanced search the callnumber and standard number
  options shouldn't have "phr"
- Change OPACNumbersPreferPhrase and IntranetNumbersPreferPhrase to "use"
- The options listed before should use now the operator "phr"
- This will resolve the problems with the searches of callnumbers and
  standard numbers in OPAC and staff client (spaces problems, no
  results, inconsistent results, etc...)

Sponsored-by: KEEP SOLUTIONS
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

I don't know how to reproduce the searching problems described in the
bug, but I can confirm that the patch works correctly to enable/disable
the use of 'phr' in the searches described in the test plan.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
System preferences work as described, switching indexes in
OPAC and staff.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-02-15 18:30:15 -05:00

347 lines
17 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %]
catalog &rsaquo; Advanced search
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" language="javascript">//<![CDATA[
$(document).ready(function() {
$('#advsearches').tabs();
});
//]]>
</script>
</head>
<body id="advsearch"><div id="doc3" class="yui-t7">
<div id="bd">
[% INCLUDE 'masthead.inc' %]
<div id="yui-main">
<form action="/cgi-bin/koha/opac-search.pl" method="get">
<div class="yui-g">
[% IF ( if_expanded_options_actually_worked ) %]
<div id="databases" class="container"> [% IF ( outer_servers_loop ) %]
<!-- DATABASES -->
<fieldset>
<legend>Select local databases:</legend>
[% FOREACH outer_servers_loo IN outer_servers_loop %]
[% FOREACH inner_servers_loo IN outer_servers_loo.inner_servers_loop %]
[% IF ( inner_servers_loo.checked ) %]<input type="checkbox" id="[% inner_servers_loo.id %]" name="[% inner_servers_loo.name %]" checked="[% inner_servers_loo.checked %]" value="[% inner_servers_loo.value %]" />[% ELSE %]
<input type="checkbox" id="[% inner_servers_loo.id %]" name="[% inner_servers_loo.name %]" value="[% inner_servers_loo.value %]" />[% END %]
<label for="[% inner_servers_loo.id %]"><img width="16" height="16" alt="[% inner_servers_loo.id %]" src="[% themelang %]/images/[% inner_servers_loo.icon %]" /> [% inner_servers_loo.label %]</label>
[% END %]
[% END %]
</fieldset>
<!-- /DATABASES -->
[% END %]
[% IF ( outer_sup_servers_loop ) %]
<!-- REMOTE DATABASES -->
<fieldset>
<legend>Select remote databases:</legend>
[% FOREACH outer_sup_servers_loo IN outer_sup_servers_loop %]
[% FOREACH inner_sup_servers_loo IN outer_sup_servers_loo.inner_sup_servers_loop %]
[% IF ( inner_sup_servers_loo.checked ) %]<input type="checkbox" id="[% inner_sup_servers_loo.id %]" name="[% inner_sup_servers_loo.name %]" checked="[% inner_sup_servers_loo.checked %]" value="[% inner_sup_servers_loo.value %]" /><input type="checkbox" id="[% inner_sup_servers_loo.id %]" name="[% inner_sup_servers_loo.name %]" value="[% inner_sup_servers_loo.value %]" />
[% END %]
<label for="[% inner_sup_servers_loo.id %]"><img alt="[% inner_sup_servers_loo.id %]" src="[% themelang %]/images/[% inner_sup_servers_loo.icon %]" />[% inner_sup_servers_loo.label %]</label>
[% END %]
[% END %]
</fieldset>
<!-- /REMOTE DATABASES -->
[% END %]</div>
[% END %]
<!-- BOOLEAN SEARCH OPTIONS -->
<div id="booleansearch" class="container"><fieldset>
<legend>Search for:</legend>
[% FOREACH search_box IN search_boxes_loop %]
<p>
[% IF ( expanded_options ) %]
[% IF ( search_box.boolean ) %]
<select name="op">
<option value="and" selected="selected">and</option>
<option value="or">or</option>
<option value="not">not</option>
</select>
[% END %]
[% END %]
[% IF ( expanded_options ) %][% left_content %][% END %]
<select name="idx">
<option value="kw">Keyword</option>
<option value="su,wrdl">Subject</option>
[% IF ( expanded_options ) %]
<option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject phrase</option>
<option value="su-br">&nbsp;&nbsp;&nbsp;&nbsp; Subject and broader terms</option>
<option value="su-na">&nbsp;&nbsp;&nbsp;&nbsp; Subject and narrower terms</option>
<option value="su-rl">&nbsp;&nbsp;&nbsp;&nbsp; Subject and related terms</option>
[% END %]
<option value="ti">Title</option>
[% IF ( expanded_options ) %]
<option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title phrase</option>
<option value="se,wrdl">Series title</option>
[% IF ( numbersphr) %]
<option value="callnum,phr">Call number</option>
[% ELSE %]
<option value="callnum">Call number</option>
[% END %]
<option value="location">Shelving location</option>
[% END %]
<option value="au,wrdl">Author</option>
[% IF ( expanded_options ) %]
<option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author phrase</option>
<option value="cpn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name</option>
<option value="cfn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Conference name</option>
<option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference name phrase</option>
<option value="pn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Personal name</option>
<option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal name phrase</option>
[% END %]
[% IF ( expanded_options ) %]
<option value="nt">Notes/Comments</option>
[% IF (marcflavour != 'UNIMARC') %]
<option value="curriculum">Curriculum</option>
[% END %]
[% END %]
<option value="pb,wrdl">Publisher</option>
<option value="pl,wrdl">Publisher location</option>
[% IF ( expanded_options ) %]
[% IF ( numbersphr) %]
<option value="sn,phr">Standard number</option>
[% ELSE %]
<option value="sn">Standard number</option>
[% END %]
<option value="sn">Standard number</option>
<option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
<option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
[% IF ( numbersphr) %]
<option value="lcn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
[% ELSE %]
<option value="lcn">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
[% END %]
[% ELSE %]
<option value="nb">ISBN</option>
[% END %]
<option value="bc">Barcode</option>
</select>
<input type="text" size="30" name="q" title="Enter search terms" value="" />
[% IF ( expanded_options ) %]
<!-- [% IF ( search_box.scan_index ) %]<input type="checkbox" name="scan" id="scan" value="1" /> Scan Indexes[% END %] -->
[% IF ( search_box.add_field ) %]<a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>[% END %]
[% END %]
</p>
[% END %]
</fieldset></div>
</div>
<div class="yui-g"><div class="container" style="text-align: center;"><!-- SEARCH BUTTONS -->
<input class="submit" type="submit" accesskey="s" name="do" title="Search" value="Search" />
[% IF ( expanded_options ) %]
<a href="/cgi-bin/koha/opac-search.pl?expanded_options=0">[Fewer options]</a>
[% ELSE %]
<a href="/cgi-bin/koha/opac-search.pl?expanded_options=1">[More options]</a>
[% END %]
<a href="/cgi-bin/koha/opac-search.pl?do=Clear">[New search]</a>
<!-- /SEARCH BUTTONS --></div></div>
<div class="yui-g">
<div id="pubrange" class="container">
<fieldset>
<!-- PUB RANGE OPTION -->
<legend>Publication date range:</legend>
<p>For example: 1999-2001. You could also use "-1987" for everything published in and before 1987 or "2008-" for everything published in 2008 and after.</p>
<input type="text" size="30" name="limit-yr" title="Enter search terms" value="" />
</fieldset>
<!-- /PUB RANGE OPTION -->
</div>
</div>
<div class="yui-g">
<div id="advsearches" class="toptabs">
<ul>
[% FOREACH advsearchloo IN advancedsearchesloop %]
<li id="advsearch-tab-[% advsearchloo.advanced_search_type %]">
<a href="#advsearch-[% advsearchloo.advanced_search_type %]">
[% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
[% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
[% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
[% ELSE %]Something else
[% END %]
</a>
</li>
[% END %]
</ul>
<!-- /BOOLEAN SEARCH OPTIONS -->
[% FOREACH advsearchloo IN advancedsearchesloop %]
<div id="advsearch-[% advsearchloo.advanced_search_type %]" class="container advsearch">
<fieldset>
<legend>Limit to any of the following:</legend>
<table>
<tr>
[% FOREACH itemtypeloo IN advsearchloo.code_loop %]
<td><input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]" name="limit" value="mc-[% itemtypeloo.ccl %]:[% itemtypeloo.code %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]">[% UNLESS ( noItemTypeImages ) %][% IF ( itemtypeloo.imageurl ) %]<img border="0" src="[% itemtypeloo.imageurl %]" alt="[% itemtypeloo.description %]" />[% END %]&nbsp;[% END %]
[% itemtypeloo.description %]</label></td>
[% IF ( loop.last ) %]</tr>[% ELSE %][% UNLESS ( loop.count % 5 ) %]</tr><tr>[% END %][% END %]
[% END %]
</table>
</fieldset>
</div>
[% END %]
</div>
<div id="langfilter">
<fieldset><legend>Language</legend>
<!-- LANGUAGE LIMIT -->
<p><label for="language-limit">Language: </label>
<select id="language-limit" name="limit">
<option value="">No limit</option>
[% FOREACH search_languages_loo IN search_languages_loop %]
[% IF ( search_languages_loo.selected ) %]
<option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]" selected="selected">[% search_languages_loo.language_description %]</option>
[% ELSE %]
<option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]">[% search_languages_loo.language_description %]</option>
[% END %]
[% END %]
</select></p><!-- <a href="">Show all languages</a>-->
<!-- /LANGUAGE LIMIT -->
</fieldset>
</div>
[% IF ( expanded_options ) %]
[% IF ( usmarc ) %]
<!-- SUBTYPE LIMITS -->
<div id="subtypes" class="container"><fieldset>
<legend>Subtype limits</legend><select name="limit" class="subtype">
<option value="" selected="selected" class="menuheader">Any audience</option>
<option value="aud:a">Preschool</option>
<option value="aud:b">Primary</option>
<option value="aud:c">Pre-adolescent</option>
<option value="aud:d">Adolescent</option>
<option value="aud:e">Adult</option>
<option value="aud:f">Specialized</option>
<option value="aud:g">General</option>
<option value="aud:j">Juvenile</option>
</select>
<select name="limit" class="subtype">
<option value="" selected="selected" class="menuheader">Any content</option>
<option value="fic:1">Fiction</option>
<option value="fic:0">Non fiction</option>
<option value="bio:b">Biography</option>
<option value="mus:j">Musical recording</option>
<option value="mus:i">Non-musical recording</option>
</select>
<select name="limit" class="subtype">
<option value="" selected="selected" class="menuheader">Any format</option>
<option value="l-format:ta">Regular print</option>
<option value="l-format:tb">Large print</option>
<option value="l-format:fk">Braille</option>
<option value="">-----------</option>
<option value="l-format:sd">CD audio</option>
<option value="l-format:ss">Cassette recording</option>
<option value="l-format:vf">VHS tape / Videocassette</option>
<option value="l-format:vd">DVD video / Videodisc</option>
<option value="l-format:co">CD software</option>
<option value="l-format:cr">Website</option>
</select>
<select name="limit" class="subtype">
<option value="">Additional content types for books/printed materials</option>
<option value="ctype:a">Abstracts/summaries</option>
<option value="ctype:b">Bibliographies</option>
<option value="ctype:c">Catalogs</option>
<option value="ctype:d">Dictionaries</option>
<option value="ctype:e">Encyclopedias </option>
<option value="ctype:f">Handbooks</option>
<option value="ctype:g">Legal articles</option>
<option value="ctype:i">Indexes</option>
<option value="ctype:j">Patent document</option>
<option value="ctype:k">Discographies</option>
<option value="ctype:l">Legislation</option>
<option value="ctype:m">Theses</option>
<option value="ctype:n">Surveys</option>
<option value="ctype:o">Reviews</option>
<option value="ctype:p">Programmed texts</option>
<option value="ctype:q">Filmographies</option>
<option value="ctype:r">Directories</option>
<option value="ctype:s">Statistics</option>
<option value="ctype:t">Technical reports</option>
<option value="ctype:v">Legal cases and case notes</option>
<option value="ctype:w">Law reports and digests</option>
<option value="ctype:z">Treaties </option>
</select>
</fieldset></div>
[% END %]
[% IF ( UNIMARC ) %]
<div id="subtypes_unimarc" class="container"><!-- SUBTYPE LIMITS -->
[% INCLUDE 'subtypes_unimarc.inc' %]</div>
[% END %]
[% END %]
</div>
<div class="yui-g">
<div class="yui-u first">
<!-- AVAILABILITY LIMITS -->
[% UNLESS ( singleBranchMode ) %]
<div id="location" class="container"><fieldset><legend>Location and availability: </legend>
<label for="branchloop">Library:</label>
<select name="limit" id="branchloop">
<option value="">All libraries</option>
[% FOREACH BranchesLoo IN BranchesLoop %]
[% IF ( BranchesLoo.selected ) %]
<option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
[% ELSE %]
<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
[% END %]
[% END %]
</select>
[% IF ( searchdomainloop ) %]
<p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
<label for="categoryloop">Groups of libraries</label><select name="multibranchlimit" id="categoryloop">
<option value=""> -- none -- </option>
[% FOREACH searchdomainloo IN searchdomainloop %]
<option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
[% 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>
</fieldset></div>
[% END %]
<!-- /AVAILABILITY LIMITS -->
</div>
<div class="yui-u">
<!-- RANK LIMITS -->
<div id="sortby" class="container"><fieldset><legend>Sorting: </legend>
<label for="sort_by">Sort by:</label> <select id="sort_by" name="sort_by">
[% INCLUDE 'resort_form.inc' %]
</select></fieldset></div>
<!-- RANK LIMITS -->
</div>
</div>
<div class="yui-g"><div class="container" style="text-align: center;"><!-- SEARCH BUTTONS -->
<input class="submit" type="submit" accesskey="s" name="do" title="Search" value="Search" />
[% IF ( expanded_options ) %]
<a href="/cgi-bin/koha/opac-search.pl?expanded_options=0">[Fewer options]</a>
[% ELSE %]
<a href="/cgi-bin/koha/opac-search.pl?expanded_options=1">[More options]</a>
[% END %]
<a href="/cgi-bin/koha/opac-search.pl?do=Clear">[New search]</a>
<!-- /SEARCH BUTTONS --></div></div>
</form>
</div>
<script type="text/javascript" language="javascript">
/* This function allows to display a new field to search.
*/
function add_field() {
var ButtonPlus = document.getElementById('ButtonPlus');
var line = ButtonPlus.parentNode;
line.parentNode.appendChild(line.cloneNode(true));
line.removeChild(ButtonPlus);
}
</script>
</div>
[% INCLUDE 'opac-bottom.inc' %]