From 19657f4c7a7eeaa958c9387086a3d11b1337eaa4 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 19 Oct 2023 09:35:32 +0000 Subject: [PATCH] Bug 35106: Add patron search autocomplete to Patron ID input Test plan, k-t-d: 1) Install FreeForm and enable ILLmodule, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) 2) Visit /cgi-bin/koha/ill/ill-requests.pl 3) Create 'New ILL request' 4) Select the request type, input cardnumber '42' and select a library. Hit 'Create' 5) Manage the request created just now: click the request id or 'manage request' button from the table 6) Click "Edit request" from the top actions toolbar 7) Input text in Patron ID e.g. 'koha'. Notice you get patron suggestions. 8) Click one of the suggestions and save the request, notice the patron is saved correctly. --- .../prog/en/modules/ill/ill-requests.tt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 87d73fc747..cb55d907e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -396,7 +396,7 @@ [% ELSIF query_type == 'edit_action' %] -
+
Request details
    @@ -945,6 +945,18 @@ $('.ill_checkout_due_date').show(); } }); + + if ($("#ill_edit_action_form #borrowernumber").length) { + patron_autocomplete( + $('#ill_edit_action_form #borrowernumber'), { + 'on-select-callback': function(event, ui) { + $("#ill_edit_action_form #borrowernumber").val(ui.item.patron_id); + return false; + } + } + ); + } + [% INCLUDE 'ill-list-table-strings.inc' %] [% INCLUDE 'ill-batch-table-strings.inc' %] -- 2.30.2