Bug 25498: (follow-up) Change for autocomplete change of 30578

Test plan:
Check if the patron search still works on the intranet shelves form
when transferring ownership.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2022-07-19 12:18:21 +00:00 committed by Tomas Cohen Arazi
parent 443c71fa00
commit dc5431c8ec
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -892,21 +892,12 @@
[% IF op == 'transfer' %]
$(document).ready(function() {
$('#find_patron').autocomplete({
source: "/cgi-bin/koha/circ/ysearch.pl",
minLength: 3,
select: function( event, ui ) {
$('#new_owner_name').html( ui.item.firstname + " " + ui.item.surname );
$('#new_owner').val( ui.item.borrowernumber );
$('#find_patron').val('').focus();
return false;
},
}).data('ui-autocomplete')._renderItem = function( ul, item ) {
return $('<li></li>')
.data( 'ui-autocomplete-item', item )
.append( '<a>' + item.surname + ', ' + item.firstname + '</a>' )
.appendTo(ul);
};
patron_autocomplete( $("#find_patron"), { 'on-select-callback': function( event, ui ) {
$('#new_owner_name').html( ui.item.firstname + " " + ui.item.surname );
$('#new_owner').val( ui.item.patron_id );
$('#find_patron').val('').focus();
return false;
}});
$('#transferform').submit(function() {
if( $('#new_owner').val() == '' ) {