The Patron ID input in the 'Edit request' screen could provide search patron suggestions to help staff members pick the correct patron.
Created attachment 157421 [details] [review] 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.
Created attachment 157422 [details] [review] Bug 35106: Validate entered borrowernumber and biblio_id Following up from the test plan of the previous patch: 1) Edit the request again, input gibberish in the Patron ID e.g. 'asdasd' 2) Hit 'Submit' 3) Notice you get a 'The Patron ID you entered is invalid.' message. 4) Edit again, try to empty the input on the Patron ID, hit 'Submit'. 5) Notice it saves the patron as null, as expected Repeat the test plan, but now for the Bibliographic record ID, notice the message 'The Bibliographic record ID you entered is invalid.' is shown if a no biblio was found.
I get an error when the page loads: Uncaught TypeError: can't access property "_renderItem", node.autocomplete(...).data(...) is undefined patron_autocomplete http://127.0.0.1:8081/intranet-tmpl/prog/js/staff-global_23.0600038.js:490 <anonymous> http://127.0.0.1:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm:1826 staff-global_23.0600038.js:490:10
(In reply to Owen Leonard from comment #3) > I get an error when the page loads: > > Uncaught TypeError: can't access property "_renderItem", > node.autocomplete(...).data(...) is undefined > patron_autocomplete > http://127.0.0.1:8081/intranet-tmpl/prog/js/staff-global_23.0600038.js:490 > <anonymous> > http://127.0.0.1:8081/cgi-bin/koha/ill/ill-requests. > pl?method=create&backend=FreeForm:1826 > staff-global_23.0600038.js:490:10 Hi Owen thank you so much for testing. What step/page exactly does this error show?
Created attachment 157498 [details] [review] 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.
Created attachment 157499 [details] [review] Bug 35106: Validate entered borrowernumber and biblio_id Following up from the test plan of the previous patch: 1) Edit the request again, input gibberish in the Patron ID e.g. 'asdasd' 2) Hit 'Submit' 3) Notice you get a 'The Patron ID you entered is invalid.' message. 4) Edit again, try to empty the input on the Patron ID, hit 'Submit'. 5) Notice it saves the patron as null, as expected Repeat the test plan, but now for the Bibliographic record ID, notice the message 'The Bibliographic record ID you entered is invalid.' is shown if a no biblio was found.
(In reply to Owen Leonard from comment #3) > I get an error when the page loads: > > Uncaught TypeError: can't access property "_renderItem", > node.autocomplete(...).data(...) is undefined > patron_autocomplete > http://127.0.0.1:8081/intranet-tmpl/prog/js/staff-global_23.0600038.js:490 > <anonymous> > http://127.0.0.1:8081/cgi-bin/koha/ill/ill-requests. > pl?method=create&backend=FreeForm:1826 > staff-global_23.0600038.js:490:10 I was able to reproduce this, thanks! I've squashed the fix to the original "Add patron search autocomplete to Patron ID input" patch, can you please try again when convenient? Thanks!
Created attachment 159934 [details] [review] 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 <david@davidnind.com>
Created attachment 159935 [details] [review] Bug 35106: Validate entered borrowernumber and biblio_id Following up from the test plan of the previous patch: 1) Edit the request again, input gibberish in the Patron ID e.g. 'asdasd' 2) Hit 'Submit' 3) Notice you get a 'The Patron ID you entered is invalid.' message. 4) Edit again, try to empty the input on the Patron ID, hit 'Submit'. 5) Notice it saves the patron as null, as expected Repeat the test plan, but now for the Bibliographic record ID, notice the message 'The Bibliographic record ID you entered is invalid.' is shown if a no biblio was found. Signed-off-by: David Nind <david@davidnind.com>
I've signed off as it does what it says in the test plan, but just have one comment. 1. Error messages: these are plain text above the "Request details" section, but are different from how "normal" error messages are displayed. Normally in a coloured box (yellow I think?) in the center.
(In reply to David Nind from comment #10) > I've signed off as it does what it says in the test plan, but just have one > comment. > > 1. Error messages: these are plain text above the "Request details" section, > but are different from how "normal" error messages are displayed. Normally > in a coloured box (yellow I think?) in the center. Thank you David, you're right. I've opened bug 35589.
Pedro, please rebase. The second patch seems harder to rebase so I leave it to you.
Created attachment 164258 [details] [review] 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 <david@davidnind.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 164259 [details] [review] Bug 35106: Validate entered borrowernumber and biblio_id Following up from the test plan of the previous patch: 1) Edit the request again, input gibberish in the Patron ID e.g. 'asdasd' 2) Hit 'Submit' 3) Notice you get a 'The Patron ID you entered is invalid.' message. 4) Edit again, try to empty the input on the Patron ID, hit 'Submit'. 5) Notice it saves the patron as null, as expected Repeat the test plan, but now for the Bibliographic record ID, notice the message 'The Bibliographic record ID you entered is invalid.' is shown if a no biblio was found. Signed-off-by: David Nind <david@davidnind.com> squash this Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 164260 [details] [review] Bug 35106: CSRF fix The removal of 'cud-' from op needs to happen sooner because ill-requests.tt expects 'edit_action' op, not 'cud-edit_action'. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
(In reply to Tomás Cohen Arazi from comment #12) > Pedro, please rebase. The second patch seems harder to rebase so I leave it > to you. Had to submit a follow-up fix related to CSRF when trying to follow test plan for patch #2.
Created attachment 165543 [details] [review] 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 <david@davidnind.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 165544 [details] [review] Bug 35106: Validate entered borrowernumber and biblio_id Following up from the test plan of the previous patch: 1) Edit the request again, input gibberish in the Patron ID e.g. 'asdasd' 2) Hit 'Submit' 3) Notice you get a 'The Patron ID you entered is invalid.' message. 4) Edit again, try to empty the input on the Patron ID, hit 'Submit'. 5) Notice it saves the patron as null, as expected Repeat the test plan, but now for the Bibliographic record ID, notice the message 'The Bibliographic record ID you entered is invalid.' is shown if a no biblio was found. Signed-off-by: David Nind <david@davidnind.com> squash this Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 165545 [details] [review] Bug 35106: CSRF fix The removal of 'cud-' from op needs to happen sooner because ill-requests.tt expects 'edit_action' op, not 'cud-edit_action'. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Capitalization: + <pre>The Patron ID you entered is invalid.</pre> + [% CASE 'invalid_biblio' %] + <pre>The Bibliographic record ID you entered is invalid.</pre> Bilbiographic and Patron should be lower case. Fixing the capitalization inline. Also wondering: We don't use Patron ID anywhere in the GUI - should this be cardnumber or username?
Pushed for 24.05! Well done everyone, thank you!
It appears ILL was submitted with "Borrower number" in the UI but was QAd to have "Patron ID" instead: https://github.com/Koha-Community/Koha/commit/a85ac6b I don't have an opinion on it and would not be against changing it or keeping it.
(In reply to Pedro Amorim from comment #22) > It appears ILL was submitted with "Borrower number" in the UI but was QAd to > have "Patron ID" instead: > https://github.com/Koha-Community/Koha/commit/a85ac6b > > I don't have an opinion on it and would not be against changing it or > keeping it. Let's see if we get a stronger vote one way or the other. Since we can now properly, I think Patron ID is much better than Borrower number already.
Not backported to 23.11.x