diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index d64f6bb580..1e2060a119 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -95,9 +95,13 @@ var obj = $( "#findborrower" ).autocomplete({ source: "/cgi-bin/koha/circ/ysearch.pl", minLength: 3, + select: function( event, ui ) { + window.location.href = ui.item.link; + } }).data( "ui-autocomplete" ); if( obj ) { obj._renderItem = function( ul, item ) { + item.link = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + item.borrowernumber; var cardnumber = ""; if( item.cardnumber != "" ){ // Display card number in parentheses if it exists @@ -105,7 +109,7 @@ } return $( "
" ) .data( "ui-autocomplete-item", item ) - .append( "" + item.surname + ", " + item.firstname + cardnumber + " " + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "" ) + .append( "" + item.surname + ", " + item.firstname + cardnumber + " " + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "" ) .appendTo( ul ); }; }