From: Marc Véron Date: Sat, 5 Sep 2015 14:41:58 +0000 (+0200) Subject: Bug 14782: Add possibility to search patrons using the username (userid) X-Git-Tag: v3.22.00-beta~628 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=a71cc14a52589f45bc30dad81b8c7fc0ac35d9fc;hp=f704fbebd86e0034cf285b2dd29c0d85cb2086a2;p=koha_ffzg Bug 14782: Add possibility to search patrons using the username (userid) This patch makes it possible to search for users using the username (userid / login name). To test: - Apply patch - Do searches from Home > Patrons - Search after a full username or parts of a username with Search fields = Standard and Search fields = Userid - Perform the searches from the top bar (expand with [+]) and from the "Filters" part at the left - Make sure that other searches behave as before Signed-off-by: Joonas Kylmälä Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index cdaa33f0ea..4240fa0eab 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/C4/Utils/DataTables/Members.pm @@ -61,9 +61,10 @@ sub search { # split on coma $searchmember =~ s/,/ /g if $searchmember; my $searchfields = { - standard => 'surname,firstname,othernames,cardnumber', + standard => 'surname,firstname,othernames,cardnumber,userid', email => 'email,emailpro,B_email', borrowernumber => 'borrowernumber', + userid => 'userid', phone => 'phone,phonepro,B_phone,altcontactphone,mobile', address => 'streettype,address,address2,city,state,zipcode,country', dateofbirth => 'dateofbirth', 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 646c70a1d8..bb09574759 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -32,6 +32,11 @@ [% ELSE %] [% END %] + [% IF searchfieldstype == "userid" %] + + [% ELSE %] + + [% END %] [% IF searchfieldstype == "phone" %] [% ELSE %] 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 877be25323..603920b762 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -424,6 +424,11 @@ function filterByFirstLetterSurname(letter) { [% ELSE %] [% END %] + [% IF searchfieldstype == "userid" %] + + [% ELSE %] + + [% END %] [% IF searchfieldstype == "phone" %] [% ELSE %] diff --git a/svc/members/search b/svc/members/search index 6343e2ed6a..1c2d6449ca 100755 --- a/svc/members/search +++ b/svc/members/search @@ -140,7 +140,7 @@ All following params are optional: firstletter => search patrons with surname begins with this pattern (currently only used for 1 letter) categorycode and branchcode => search patrons belong to a given categorycode or a branchcode searchtype: can be 'contain' or 'start_with' - searchfieldstype: Can be 'standard', 'email', 'borrowernumber', 'phone' or 'address' + searchfieldstype: Can be 'standard', 'email', 'borrowernumber', 'userid', 'phone' or 'address' =cut