Bug 14782: Add possibility to search patrons using the username (userid)
[koha_ffzg] / svc / members / search
index 8889773..1c2d644 100755 (executable)
@@ -4,18 +4,18 @@
 #
 # This file is part of Koha
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
 use CGI;
@@ -45,6 +45,7 @@ my $branchcode = $input->param('branchcode');
 my $searchtype = $input->param('searchtype');
 my $searchfieldstype = $input->param('searchfieldstype') || 'standard';
 my $has_permission = $input->param('has_permission');
+my $selection_type = $input->param('selection_type');
 
 if ( $searchfieldstype eq "dateofbirth" ) {
     $searchmember = output_pref({dt => dt_from_string($searchmember), dateformat => 'iso', dateonly => 1});
@@ -115,7 +116,8 @@ $template->param(
     sEcho => $sEcho,
     iTotalRecords => $results->{iTotalRecords},
     iTotalDisplayRecords => $results->{iTotalDisplayRecords},
-    aaData => $results->{patrons}
+    aaData => $results->{patrons},
+    selection_type => $selection_type,
 );
 
 output_with_http_headers $input, $cookie, $template->output, 'json';
@@ -138,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