Bugzilla – Attachment 157752 Details for
Bug 35127
Patron search ignores searchtype from the context menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35127: Fix 'Search type' for patron search
Bug-35127-Fix-Search-type-for-patron-search.patch (text/plain), 5.00 KB, created by
Lucas Gass (lukeg)
on 2023-10-24 17:24:04 UTC
(
hide
)
Description:
Bug 35127: Fix 'Search type' for patron search
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-10-24 17:24:04 UTC
Size:
5.00 KB
patch
obsolete
>From 7b2b4941048cc3d39491e8f2c8c691b4369a71bf Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 24 Oct 2023 15:32:53 +0200 >Subject: [PATCH] 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> >--- > .../intranet-tmpl/prog/en/includes/member-search-box.inc | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt | 2 +- > members/member.pl | 2 ++ > 4 files changed, 7 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >index 70c22389d27..0d02459f019 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >@@ -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 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index 18fbf429311..580a80f6a8f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -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() || "standard"; > let pattern = $("#search_patron_filter").val(); > >@@ -817,7 +817,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"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index e65241207ee..6e6a3bd92a5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -11,7 +11,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>[% FILTER collapse %] >diff --git a/members/member.pl b/members/member.pl >index 909341bcd7f..952e4a24917 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -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, >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35127
:
157745
|
157752
|
157784