@@ -, +, @@ - Add an 'edit button' - Make the dynamic patron information more consistent with the original one - Make the input field wider --- circ/ysearch.pl | 2 ++ .../prog/en/modules/suggestion/suggestion.tt | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) --- a/circ/ysearch.pl +++ a/circ/ysearch.pl @@ -29,6 +29,7 @@ use CGI qw ( -utf8 ); use C4::Context; use C4::Auth qw/check_cookie_auth/; use Koha::Borrowers; +use C4::Branch; use JSON qw( to_json ); @@ -87,6 +88,7 @@ while ( my $b = $borrowers_rs->next ) { city => $b->city // '', zipcode => $b->zipcode // '', country => $b->country // '', + branch => C4::Branch::GetBranchName($b->branchcode) // '', }; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -173,17 +173,21 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o source: "/cgi-bin/koha/circ/ysearch.pl", minLength: 3, select: function( event, ui ) { - $( "#findborrowersuggestion" ).val( ui.item.surname + ', ' + ui.item.firstname + ' (' + ui.item.cardnumber + ')' ); + $( "#findborrowersuggestion" ).val( ui.item.surname + ', ' + ui.item.firstname + ', ' + ui.item.branch); $( "#suggestedby").val( ui.item.borrowernumber ); + $( "#findborrowersuggestion" ).attr('disabled', 'disabled'); return false; } }) .data( "ui-autocomplete" )._renderItem = function( ul, item ) { return $( "
  • " ) .data( "ui-autocomplete-item", item ) - .append( "" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "" ) + .append( "" + item.surname + ", " + item.firstname + ", " + item.branch + "" ) .appendTo( ul ); }; + $( "#editborrowersuggestion" ).click(function() { + $( "#findborrowersuggestion" ).removeAttr('disabled').focus().select(); + }); }); // ]]> @@ -417,9 +421,10 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o
    [% IF ( suggestedby_borrowernumber ) %] - + + [% ELSE %] - + [% END %] --