From b58c1ad9ee08cfd7ac674e45ec8648b6d5a00fc9 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 --- .../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 6afaa7a..a66826d 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 c90d8af..5089d29 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+'