Koha/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
Aleisha Amohia a58cf90a31 Bug 26533: Fix 'is exactly' search for authorities
The exact search 6=3 is implemented, but it isn't used as expected when
you select 'is exactly' from the authorities search dropdown. This patch
remedies that.

To test:
1) Ensure you have an authority with more than one word in the name,
    i.e. Electric power production
2) Go to Authorities in the staff client.
3) Change the dropdown to 'is exactly' and search for one of the words
in your record's title, i.e. 'power' in the 'main heading' search
4) Confirm your authority shows in the results, even though it is not an
exact match.
5) Search for a biblio record and go to edit the record.
6) Go to Tab 6 and click the plugin button next to one of the 6xx$a
fields to trigger the authority finder plugin
7) Repeat Step 3 and Step 4
8) Go to the OPAC and go to Authority Search
9) Repeat Step 3 and Step 4

Apply patch

10) Repeat Steps 1 to 9, confirm that this time the record does NOT show
in search results.
11) Repeat Steps 1 to 9 but this time search for the authority record's
full title, i.e. 'Electric power production'. Confirm the record does
show in the search results because the search term now matches title exactly.

Sponsored-by: Education Services Australia SCIS

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-21 10:51:29 +02:00

163 lines
9.1 KiB
HTML

[% PROCESS 'form-blocks.inc' %]
<div id="toolbar" class="btn-toolbar">
<div class="btn-group"><a href="#" id="clear" class="btn btn-default btn-sm"><i class="fa fa-trash"></i> Clear field</a></div>
<div class="btn-group"><a href="#" id="createnew" class="btn btn-default btn-sm"><i class="fa fa-plus"></i> Create new authority</a></div>
</div>
<form name="f" method="get" action="auth_finder.pl">
<input type="hidden" name="source" value="[% source | html %]" />
<input type="hidden" name="op" value="do_search" />
<input type="hidden" name="type" value="intranet" />
<input type="hidden" name="index" value="[% index | html %]" />
<fieldset class="rows"><legend>Search options</legend>
<ol><li>
<span class="label">Authority type: </span>
[% authtypecode | html %]
<input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
</li>
<li>
<label for="mainmainentry">Search main heading ($a only): </label>
<input type="hidden" name="marclist" value="mainmainentry" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<select name="operator" id="mainmainentry">
[% IF ( operator_mainstr == 'contains' ) %]
<option value="contains" selected="selected">contains</option>
[% ELSE %]
<option value="contains">contains</option>
[% END %]
[% IF ( operator_mainstr == 'start' ) %]
<option value="start" selected="selected">starts with</option>
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_mainstr == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_mainstr" style="width:400px;" type="text" name="value_mainstr" value="[% value_mainstr | html %]" />
<div id="yvaluecontainermainmainentry"></div>
</li>
<li>
<label for="mainentry">Search main heading: </label>
<input type="hidden" name="marclist" value="mainentry" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<select name="operator" id="mainentry">
[% IF ( operator_main == 'contains' ) %]
<option value="contains" selected="selected">contains</option>
[% ELSE %]
<option value="contains">contains</option>
[% END %]
[% IF ( operator_main == 'start' ) %]
<option value="start" selected="selected">starts with</option>
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_main == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_main" style="width:400px;" type="text" name="value_main" value="[% value_main | html %]" />
<div id="yvaluecontainermainentry"></div>
</li>
<li>
<label for="marclistheading">Search all headings: </label>
<input type="hidden" name="marclist" value="match" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<select name="operator" id="marclistheading">
[% IF ( operator_match == 'contains' ) %]
<option value="contains" selected="selected">contains</option>
[% ELSE %]
<option value="contains">contains</option>
[% END %]
[% IF ( operator_match == 'start' ) %]
<option value="start" selected="selected">starts with</option>
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_match == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="exact">is exactly</option>
[% END %]
</select>
<input type="text" name="value_match" value="[% value_match | html %]" />
</li>
<li>
<label for="marclistanywhere">Search entire record: </label>
<input type="hidden" name="marclist" value="all" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<select name="operator" id="marclistanywhere">
[% IF ( operator_any == 'contains' ) %]
<option value="contains" selected="selected">contains</option>
[% ELSE %]
<option value="contains">contains</option>
[% END %]
[% IF ( operator_any == 'start' ) %]
<option value="start" selected="selected">starts with</option>
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_any == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_any" style="width:400px;" type="text" name="value_any" value="[% value_any | html %]" />
<div id="yvaluecontainermarclist"></div>
</li>
<li>
<label for="orderby">Sort by: </label>
<select name="orderby" id="orderby">
[% IF ( orderby == 'HeadingAsc' ) %]
<option value="HeadingAsc" selected="selected">Heading A-Z</option>
[% ELSE %]
<option value="HeadingAsc">Heading A-Z</option>
[% END %]
[% IF ( orderby == 'HeadingDsc' ) %]
<option value="HeadingDsc" selected="selected">Heading Z-A</option>
[% ELSE %]
<option value="HeadingDsc">Heading Z-A</option>
[% END %]
[% IF ( orderby == '' && op ) %]
<option value="" selected="selected">None</option>
[% ELSE %]
<option value="">None</option>
[% END %]
</select>
</li></ol></fieldset>
[% IF source == 'auth' %]
<fieldset class="rows"><legend>Relationship information</legend>
<ol>
<li>
<label for="relationship">Special relationship: </label>
<select name="relationship" id="relationship">
[% selected=relationship | html %]
[% PROCESS selectoptionopen value='' %]None specified</option>
[% PROCESS selectoptionopen value='a' %]a - Earlier heading</option>
[% PROCESS selectoptionopen value='b' %]b - Later heading</option>
[% PROCESS selectoptionopen value='d' %]d - Acronym</option>
[% PROCESS selectoptionopen value='f' %]f - Musical composition</option>
[% PROCESS selectoptionopen value='g' %]g - Broader term</option>
[% PROCESS selectoptionopen value='h' %]h - Narrower term</option>
[% PROCESS selectoptionopen value='i' %]i - Reference instruction phrase in subfield $i</option>
[% PROCESS selectoptionopen value='n' %]n - Not applicable</option>
[% PROCESS selectoptionopen value='r' %]r - Relationship designation in $i or $4</option>
[% PROCESS selectoptionopen value='t' %]t - Immediate parent body</option>
</select>
</li>
</ol>
</fieldset>
[% END %]
<fieldset class="action"> <input type="submit" value="Search" class="submit" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a>
</fieldset>
</form>