The patron search type is hard coded to 'contain' in
circ/circulation.pl.
This causes problems because a mis-scanned cardnumber can bring up the
wrong patron.
The example that our partner gave us involved scanning '1733', which
doesn't match any borrowers when we do a 'start_with' search, but
matches the cardnumber 'p291733'.
If we follow the usage in members/member.pl, we can set searchtype in
HTTP params, which is amenable to fixes in intranetuserjs
Test Plan:
1) Apply this patch
2) Use the checkout search, not changes should be noted
Extra credit:
1) Add javascript to intranetuserjs to add a hidden input named
'searchtype' with the value 'start_with'
2) Checkout searches should now give only results where a searched
field starts with the given string(s)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
our %return_failed = ();
for (@failedreturns) { $return_failed{$_} = 1; }
+my $searchtype = $query->param('searchtype') || q{contain};
+
my $findborrower = $query->param('findborrower') || q{};
$findborrower =~ s|,| |g;
my $results = C4::Utils::DataTables::Members::search(
{
searchmember => $findborrower,
- searchtype => 'contain',
- dt_params => $dt_params,
+ searchtype => $searchtype,
+ dt_params => $dt_params,
}
);
my $borrowers = $results->{patrons};