@@ -, +, @@ --- circ/ysearch.pl | 5 +++-- .../prog/en/modules/patron_lists/list.tt | 10 +++++----- patron_lists/list.pl | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) --- a/circ/ysearch.pl +++ a/circ/ysearch.pl @@ -44,7 +44,7 @@ if ($auth_status ne "ok") { } my $dbh = C4::Context->dbh; -my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country +my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country, borrowernumber FROM borrowers WHERE surname LIKE ? OR firstname LIKE ? @@ -64,8 +64,9 @@ while ( my $rec = $sth->fetchrow_hashref ) { "address\":\"".$rec->{address} . "\",\"" . "city\":\"".$rec->{city} . "\",\"" . "zipcode\":\"".$rec->{zipcode} . "\",\"" . + "borrowernumber\":\"".$rec->{borrowernumber} . "\",\"" . "country\":\"".$rec->{country} . "\"" . "}"; $i++; } -print "]"; +print "]"; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt @@ -23,9 +23,9 @@ $(document).ready(function() { })); $( "#find_patron" ).autocomplete({ source: "/cgi-bin/koha/circ/ysearch.pl", - minLength: 3, + minLength: 1, select: function( event, ui ) { - AddPatron( ui.item.surname + ", " + ui.item.firstname, ui.item.cardnumber ); + AddPatron( ui.item.surname + ", " + ui.item.firstname, ui.item.borrowernumber ); return false; } }) @@ -54,13 +54,13 @@ $(document).ready(function() { }); }); -function AddPatron( name, cardnumber ) { - div = "

" + name + " ( " + _("Remove") + " )

"; +function AddPatron( name, borrowernumber ) { + div = "

" + name + " ( " + _("Remove") + " )

"; $('#patrons_to_add').append( div ); $('#find_patron').val('').focus(); - $('#patrons_to_add_fieldset').show( ); + $('#patrons_to_add_fieldset').show(); } //]]> --- a/patron_lists/list.pl +++ a/patron_lists/list.pl @@ -42,7 +42,7 @@ my ($list) = my @patrons_to_add = $cgi->param('patrons_to_add'); if (@patrons_to_add) { - AddPatronsToList( { list => $list, cardnumbers => \@patrons_to_add } ); + AddPatronsToList( { list => $list, borrowernumbers => \@patrons_to_add } ); } my @patrons_to_remove = $cgi->param('patrons_to_remove'); --