From 2e6be2f343c46867e83b70e245fb03838ecc560e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 21 Nov 2016 11:47:00 +0000 Subject: [PATCH] Bug 17344 - Can't set guarantor in quick add brief form This patch updates the guarantor form to work with the quick add form To test: 1 - Quick add a 'Kid' patron (or other patron type that may have guarantor) 2 - Verify form appears as expected 3 - Test that you can add a patron manually or using selector 4 - Test that deletion works as expected 5 - Test 3 and 4 from the full version of the form 6 - Save or cancel and add a new patron using the full form only 7 - Verify that adding/deleting guarantor works with no errors 8 - Sign off Signed-off-by: Owen Leonard Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../prog/en/modules/members/memberentrygen.tt | 4 +++ koha-tmpl/intranet-tmpl/prog/js/members.js | 30 +++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 6afaa7aa1e..a66826da92 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1189,6 +1189,7 @@ $(document).ready(function() { diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js index c90d8af0b0..5089d29697 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members.js @@ -186,13 +186,13 @@ function update_category_code(category_code) { function select_user(borrowernumber, borrower) { var form = $('#entryform').get(0); if (form.guarantorid.value) { - $("#contact-details").find('a').remove(); - $("#contactname, #contactfirstname").parent().find('span').remove(); + $("#contact-details,#quick_add_form #contact-details").find('a').remove(); + $("#contactname, #contactfirstname,#quick_add_form #contact-details").parent().find('span').remove(); } var id = borrower.borrowernumber; form.guarantorid.value = id; - $('#contact-details') + $('#contact-details,#quick_add_form #contact-details') .show() .find('span') .after('' + id + ''); @@ -200,9 +200,11 @@ function select_user(borrowernumber, borrower) { $(form.contactname) .val(borrower.surname) .before('' + borrower.surname + '').get(0).type = 'hidden'; - $(form.contactfirstname) + $("#quick_add_form #contactname").val(borrower.surname).before(''+borrower.surname+'' + borrower.firstname + '').get(0).type = 'hidden'; + $("#quick_add_form #contactfirstname").val(borrower.firstname).before(''+borrower.firstname+'