Bug 23405 - Circulation autocomplete for patron lookup broken if cardnumber is empty
Summary: Circulation autocomplete for patron lookup broken if cardnumber is empty
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 23518
  Show dependency treegraph
 
Reported: 2019-07-31 15:25 UTC by Owen Leonard
Modified: 2019-09-09 07:23 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03,18.11.09


Attachments
Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty (3.29 KB, patch)
2019-07-31 16:12 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty (3.34 KB, patch)
2019-08-02 19:22 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty (3.39 KB, patch)
2019-08-02 19:32 UTC, Ian Walls
Details | Diff | Splinter Review
Bug 23405: Circulation autocomplete for patron lookup broken if cardnumber is empty (3.45 KB, patch)
2019-08-07 13:31 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2019-07-31 15:25:45 UTC
If CircAutocompl is enabled, the staff client's "check out" search form in the header has a patron search autocomplete feature. Selecting a result should take you to the patron's checkout screen.

Because this uses card number, it doesn't work with patrons who have no card number. It should use borrowernumber instead.
Comment 1 Owen Leonard 2019-07-31 16:12:01 UTC
Created attachment 91894 [details] [review]
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.
Comment 2 Maryse Simard 2019-08-02 19:22:03 UTC
Created attachment 91939 [details] [review]
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>
Comment 3 Ian Walls 2019-08-02 19:32:58 UTC
Created attachment 91940 [details] [review]
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>
Comment 4 Nick Clemens 2019-08-07 13:31:13 UTC
Created attachment 92041 [details] [review]
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>
Comment 5 Martin Renvoize 2019-08-08 11:43:53 UTC
Nice work!

Pushed to master for 19.11.00
Comment 6 Fridolin SOMERS 2019-08-09 14:03:17 UTC
Pushed to 19.05.x for 19.05.03
Comment 7 Lucas Gass 2019-08-28 15:31:03 UTC
backported to 18.11.x for 18.11.09