Bug 35127: Fix 'Search type' for patron search
We need to fallback on the syspref DefaultPatronSearchMethod but keep the value when one is passed! Test plan: Search for patrons, and use the "search type". Set it to different values than DefaultPatronSearchMethod and confirm that the value is kept. Fix is expected when searching for patrons in the header (use the options to select a different value and run the search) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commite08bf3bb4c
) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commite9363693e0
) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
5cbaec63a3
commit
21462582f5
4 changed files with 7 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
|||
[% USE Koha %]
|
||||
[% PROCESS 'patronfields.inc' %]
|
||||
[% IF CAN_user_borrowers_edit_borrowers %]
|
||||
[%- SET searchtype = Koha.Preference('DefaultPatronSearchMethod') -%]
|
||||
[%- SET searchtype = searchtype || Koha.Preference('DefaultPatronSearchMethod') -%]
|
||||
[% IF( bs_tab_active ) %]
|
||||
<div id="patron_search" role="tabpanel" class="tab-pane active">
|
||||
[% ELSE %]
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
[%# - sort2: select patron sort2 field %]
|
||||
[%# - search_field: select patron field list %]
|
||||
[%# - search_type: select 'contains' or 'starts with' %]
|
||||
[%- SET searchtype = Koha.Preference('DefaultPatronSearchMethod') -%]
|
||||
[%- searchtype = searchtype || Koha.Preference('DefaultPatronSearchMethod') -%]
|
||||
[% BLOCK patron_search_filters %]
|
||||
<form id="patron_search_form">
|
||||
<fieldset class="brief">
|
||||
|
@ -318,7 +318,7 @@
|
|||
"-and": function(){
|
||||
let filters = [];
|
||||
|
||||
let search_type = $("#searchtype_filter").val() || "contains";
|
||||
let search_type = $("#searchtype_filter").val();
|
||||
let search_fields = $("#searchfieldstype_filter").val();
|
||||
let pattern = $("#search_patron_filter").val();
|
||||
|
||||
|
@ -815,7 +815,7 @@
|
|||
|
||||
function clearFilters() {
|
||||
$("#searchfieldstype_filter option:first").prop("selected", true);
|
||||
$("#searchtype_filter option[value='[% searchtype || 'contains' | html %]']").prop("selected", true);
|
||||
$("#searchtype_filter option[value='[% searchtype | html %]']").prop("selected", true);
|
||||
$("#categorycode_filter option:first").prop("selected", true);
|
||||
$("#branchcode_filter option:first").prop("selected", true);
|
||||
$("#sort1_filter").val('').trigger("change");
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
[% SET libraries = Branches.all %]
|
||||
[% SET categories = Categories.all.unblessed %]
|
||||
[% SET columns = ['cardnumber', 'name-address', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'action'] %]
|
||||
[% SET searchtype = Koha.Preference('DefaultPatronSearchMethod') %]
|
||||
[% SET searchtype = searchtype || Koha.Preference('DefaultPatronSearchMethod') %]
|
||||
[% PROCESS 'patron-search.inc' %]
|
||||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
<title>Patrons[% IF ( searching ) %] › Search results[% END %] › Koha</title>
|
||||
|
|
|
@ -65,6 +65,7 @@ if ( $quicksearch and $searchmember && !$circsearch ) {
|
|||
}
|
||||
|
||||
my $searchfieldstype = $input->param('searchfieldstype') || 'standard';
|
||||
my $searchtype = $input->param('searchtype');
|
||||
|
||||
$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
|
||||
|
||||
|
@ -75,6 +76,7 @@ $template->param(
|
|||
searchmember => $searchmember,
|
||||
branchcode_filter => scalar $input->param('branchcode_filter'),
|
||||
categorycode_filter => scalar $input->param('categorycode_filter'),
|
||||
searchtype => $searchtype,
|
||||
searchfieldstype => $searchfieldstype,
|
||||
PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
|
||||
do_not_defer_loading => !$defer_loading,
|
||||
|
|
Loading…
Reference in a new issue