From dc5431c8ec0d35e22a4b9047cbded234b1efef83 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 19 Jul 2022 12:18:21 +0000 Subject: [PATCH] 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 Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/virtualshelves/shelves.tt | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index b08607e974..356f801614 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -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 $('
  • ') - .data( 'ui-autocomplete-item', item ) - .append( '' + item.surname + ', ' + item.firstname + '' ) - .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() == '' ) { -- 2.39.5