From 721b6040990fd53c040073df0bab729e310865e1 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. Signed-off-by: David Nind Signed-off-by: Pedro Amorim Signed-off-by: Tomas Cohen Arazi --- .../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 38b41ed774e..0c5babe9aeb 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 @@ -403,7 +403,7 @@ [% ELSIF op == 'edit_action' %] -
+ [% INCLUDE 'csrf-token.inc' %]
Request details @@ -978,6 +978,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.44.0