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)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 23 Dec 2019 11:06:08 +0000 (11:06 +0000)
commit92c6d3511ee42d9040fd8c4cda1fc1661024b075
tree50317dd827dc815c44bcf14807fe3197b34fc131
parent8112e2a6361af871cada25c328ab9c04c0796fb7
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>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/js/subscription-add.js