Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc
Martin Renvoize d5608b8ff0
Bug 21978: Add support for middle name
This patch adds the new 'Middle name' field to the patron record.

To test:
1) Apply patches
2) Update database, restart all and clear the browser cache
3) Load a patron in the staff module
4) Confirm you can see and edit the new 'Middle name' field
5) Confirm the new middle name data displays on patron details
6) Confirm the new middle name data displays on patron search results
7) Confirm the new middle name data displays everywhere patron names are
   displayed.
8) Confirm the new middle name data displays on the OPAC
9) Confirm the 'Middle name' field appears in the OPAC borrower
   modification screens
10) Edit sysprefs `BorrowerMandatoryFields`, `BorrowerUnwantedFields`,
    `SelfModificationBorrowerUnwantedField`, `PatronSelfModificationMandatoryField`,
    `PatronSelfRegistrationBorrowerMandatoryField` and
    `PatronSelfRegistrationBorrowerUnwantedField` to confirm you can make
    the new field required or hidden.
11) Verify that DefaultPatronSearchFields contains the new field if you
    already had 'firstname' in the field list
12) Enable PatronAutoComplete system preference
13) Type patrons surname into checkout or patron search but don't hit
    return
14) Confirm the patrons middle name is displayed in the preview
15) Go to tools > patron lists and attempt to add a patron to a list
16) Patrons middle name should appear in the autocomplete here too

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-06-24 12:24:11 -03:00

111 lines
5.5 KiB
HTML

[% USE Koha %]
[% USE Branches %]
[% USE Categories %]
[% USE raw %]
[% PROCESS 'html_helpers.inc' %]
[% PROCESS 'patronfields.inc' %]
<div class="gradient">
<div id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName | html %]</a></div><!-- Begin Patrons Resident Search Box -->
<div id="header_search">
<div id="patron_search" class="residentsearch">
<form action="/cgi-bin/koha/members/member.pl" method="post">
<label class="tip" for="searchmember">Enter patron card number or partial name:</label>
<div class="autocomplete">
<input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" />
<input type="hidden" name="quicksearch" value="1" />
<span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span>
<span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span>
<input value="Search" class="submit" type="submit" />
</div>
<div id="filters">
<p><label for="searchfieldstype">Search fields:</label>
<select name="searchfieldstype" id="searchfieldstype">
[% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' %]
[% default_fields = [ standard, 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
[% search_options = default_fields.merge(standard.split(',')).unique %]
[% FOREACH s_o IN search_options %]
[% display_name = PROCESS patron_fields name=s_o %]
[% NEXT IF !display_name.length %]
[% IF searchfieldstype == s_o %]
<option selected="selected" value="[% s_o | html %]">[% display_name | $raw %]</option>
[% ELSE %]
<option value="[% s_o | html %]">[% display_name | $raw %]</option>
[% END %]
[% END %]
</select>
</p>
<p>
<label for="searchtype">Search type:</label>
<select name="searchtype" id="searchtype">
[% IF searchtype == 'start_with' %]
<option selected="selected" value='start_with'>Starts with</option>
<option value='contain'>Contains</option>
[% ELSE %]
<option value='start_with'>Starts with</option>
<option selected="selected" value='contain'>Contains</option>
[% END %]
</select>
</p>
<p>
<label for="branchcode">Library: </label>
[% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
<select name="branchcode_filter" id="branchcode">
[% IF branches.size != 1 %]
<option value="">Any</option>
[% END %]
[% PROCESS options_for_libraries libraries => branches %]
</select>
</p>
<p>
<label for="categorycode">Category: </label>
[% SET categories = Categories.all() %]
<select name="categorycode_filter" id="categorycode">
<option value="">Any</option>
[% FOREACH category IN categories %]
[% IF category.categorycode == categorycode_filter %]
<option value="[% category.categorycode | html %]" selected="selected">[% category.description | html %]</option>
[% ELSE %]
<option value="[% category.categorycode | html %]">[% category.description | html %]</option>
[% END %]
[% END %]
</select>
</p>
</div>
</form>
</div>
[% INCLUDE 'patron-search-box.inc' %]
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
<div id="checkin_search" class="residentsearch">
<form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
<label class="tip" for="ret_barcode">Scan a barcode to check in:</label>
<input class="head-searchbox" name="barcode" id="ret_barcode" size="40" accesskey="r" type="text" />
<input value="Submit" class="submit" type="submit" />
</form>
</div>
<div id="renew_search" class="residentsearch">
<form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off">
<label class="tip" for="ren_barcode">Scan a barcode to renew:</label>
<input class="head-searchbox" name="barcode" id="ren_barcode" size="40" type="text" />
<input value="Submit" class="submit" type="submit" />
</form>
</div>
[% END %]
[% INCLUDE 'catalogue-search-box.inc' %]
<ul>
<li><a class="keep_text" href="#patron_search">Search patrons</a></li>
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#circ_search">Check out</a></li>[% END %]
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#checkin_search">Check in</a></li>[% END %]
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]<li><a class="keep_text" href="#renew_search">Renew</a></li>[% END %]
[% IF ( CAN_user_catalogue ) %]<li><a class="keep_text" href="#catalog_search">Search the catalog</a></li>[% END %]
</ul>
</div><!-- /header_search -->
</div><!-- /gradient -->
<!-- End Patrons Resident Search Box -->