Bug 16458: Update library when a guarantor is set
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 May 2016 11:00:01 +0000 (12:00 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Sat, 4 Jun 2016 06:57:39 +0000 (06:57 +0000)
commitfc35a5099f613c08d12be1d67fd027d4a5eaf99c
treea3816214ff81a92e34d2ca4910c42a98f86a6b7b
parent6cd592ba3b18236a3c0f82873d4444c1f884f37c
Bug 16458: Update library when a guarantor is set

If you edit a patron from the Edit link of the patron information block
(step 1 of the memberentry script), the branchcode is not displayed. If
you set a guarantor to a child from this form, a JavaScript error will
be raised:
  JavaScript error form.branchcode is undefined

It happens because there is the branchcode is not displayed and there is
no element with a branchcode name.

To avoid this issue, a branchcode hidden input is added to the form and
it will be updated when a guarantor is selected (same behavior as when
you edit a patron using the complete form).

Test plan:
Edit a patron using the Edit link of the patron info block (not the Edit
button in the toolbar)
Set a guarantor
=> Notice that the branchcode of the patron has been updated with the
branchcode of the guarantor

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt