This patch makes it possible to limit a patron search to
search just for surnames.
To test:
- Apply the patch
- Add two patrons, called e.g. "John Doe" and "Doe John"
- Go to Patrons in the Intranet
- Make sure you have selected "Search fields" = Standard
- Search for "john" and verify both patrons show up
- Search for "doe" and verify both patrons show up
- Set "Search fields" = Surname and search for "john".
"Doe John" should show up, but not "John Doe".
- Set "Search fields" = Surname and search for "doe".
"John Doe" should show up, but not "Doe John".
Update: Revised the last point in the test plan.
Sponsored-by: Alingsås Public Library, Sweden
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
my $searchfields = {
standard => 'surname,firstname,othernames,cardnumber,userid',
+ surname => 'surname',
email => 'email,emailpro,B_email',
borrowernumber => 'borrowernumber',
userid => 'userid',
[% ELSE %]
<option value='standard'>Standard</option>
[% END %]
+ [% IF searchfieldstype == "surname" %]
+ <option selected="selected" value='surname'>Surname</option>
+ [% ELSE %]
+ <option value='surname'>Surname</option>
+ [% END %]
[% IF searchfieldstype == "email" %]
<option selected="selected" value='email'>Email</option>
[% ELSE %]
[% ELSE %]
<option value='standard'>Standard</option>
[% END %]
+ [% IF searchfieldstype == "surname" %]
+ <option selected="selected" value='surname'>Surname</option>
+ [% ELSE %]
+ <option value='surname'>Surname</option>
+ [% END %]
[% IF searchfieldstype == "email" %]
<option selected="selected" value='email'>Email</option>
[% ELSE %]