Bug 14782: Add possibility to search patrons using the username (userid)
authorMarc Véron <veron@veron.ch>
Sat, 5 Sep 2015 14:41:58 +0000 (16:41 +0200)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Wed, 16 Sep 2015 13:36:56 +0000 (10:36 -0300)
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ä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
C4/Utils/DataTables/Members.pm
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
svc/members/search

index cdaa33f..4240fa0 100644 (file)
@@ -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',
index 646c70a..bb09574 100644 (file)
               [% ELSE %]
                 <option value='borrowernumber'>Borrower number</option>
               [% END %]
+              [% IF searchfieldstype == "userid" %]
+                <option selected="selected" value='userid'>Username</option>
+              [% ELSE %]
+                <option value='userid'>Username</option>
+              [% END %]
               [% IF searchfieldstype == "phone" %]
                 <option selected="selected" value='phone'>Phone number</option>
               [% ELSE %]
index 877be25..603920b 100644 (file)
@@ -424,6 +424,11 @@ function filterByFirstLetterSurname(letter) {
                 [% ELSE %]
                   <option value='borrowernumber'>Borrower number</option>
                 [% END %]
+                [% IF searchfieldstype == "userid" %]
+                  <option selected="selected" value='userid'>Username</option>
+                [% ELSE %]
+                  <option value='userid'>Username</option>
+                [% END %]
                 [% IF searchfieldstype == "phone" %]
                   <option selected="selected" value='phone'>Phone number</option>
                 [% ELSE %]
index 6343e2e..1c2d644 100755 (executable)
@@ -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