Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty
authorOwen Leonard <oleonard@myacpl.org>
Wed, 31 Jul 2019 16:01:39 +0000 (16:01 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 9 Aug 2019 14:51:35 +0000 (16:51 +0200)
commiteb2ecf828bb3a1a55d0559d350fe6c308a1e1a7a
treefffdb7333f891e5cf35edbd5f2296b304c96a5c4
parent865843866f0a72e15d46e018a448cbdf1c57bb2c
Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty

This patch modifies the JavaScript behind the patron search
results autocomplete widget which is displayed when typing in the search
header's "Check out" tab.

The script is modified to use the patron's borrowernumber instead of
cardnumber when redirecting to the checkout page.

Instead of copying the patron's card number into the search form and
triggering a submit, the autocomplete output uses direct links to each
result.

To better handle patrons with no card number, the output is modified to
show card number with parentheses only if card number is present.

To test you should have a patron in your database which has no card
number. Make sure CircAutocompl is enabled.

- From the circulation home page, type a patron name in the "Check out"
  form and wait for autocomplete search results to display.

- Patrons with a card number should be listed in the format: Surname,
  First name (Card number) Address.

- Patrons without a card number should be listed as: Surname, First
  name Address.

- Clicking on either kind of result should link you the checkout screen
  for that patron.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Ian Walls <ian@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 82a0f5913974155bd79f82cf2075936de7b0c431)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc