Bug 21232: Add a client-side check on biblionumber when creating a subscription
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 13 Dec 2019 11:41:20 +0000 (12:41 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 13 Jan 2020 22:07:47 +0000 (22:07 +0000)
commit9f312ebc91834dcf9a0355c2bf5704047786e35a
tree4fb75cf7f196d427b92589d2d8d5998fe7b8f054
parent9c03f710221a4d17ee6e861fc0f3b3507716d249
Bug 21232: Add a client-side check on biblionumber when creating a subscription

This patch adds an AJAX call to the REST API (/api/v1/biblios/) to
retrieve and display the biblio's title.
On clicking the "next" button a check is done to make sure the title
exists, which means the biblionumber we manually entered is valid (can
we assume a title is mandatory?)

Test plan:
- Create or edit a new subscription
- Enter an invalid biblionumber in the input
=> A friendly note is telling you that the biblio does not exist
- Try to switch to the next screen
=> You get an alert
- Enter a valid biblionumber in the input
=> The title is displayed
=> Try to switch to the next screen
=> It works!

Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 90374dacb97a69d5774234cedeeb7d741232cb53)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/js/subscription-add.js