Bugzilla – Attachment 57678 Details for
Bug 17344
Can't set guarantor in quick add brief form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 17344 - Can't set guarantor in quick add brief form
SIGNED-OFF-Bug-17344---Cant-set-guarantor-in-quick.patch (text/plain), 6.01 KB, created by
Owen Leonard
on 2016-11-21 12:58:05 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17344 - Can't set guarantor in quick add brief form
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-11-21 12:58:05 UTC
Size:
6.01 KB
patch
obsolete
>From f49d006c13404e7e2ab04d97106e8cff3ddf2f78 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 21 Nov 2016 11:47:00 +0000 >Subject: [PATCH] [SIGNED-OFF] Bug 17344 - Can't set guarantor in quick add > brief form >Content-Type: text/plain; charset="utf-8" > >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 <oleonard@myacpl.org> >--- > .../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() { > </form> > <script> > $(document).ready(function () { >+ > $("#entryform,#saverecord").hide(); > [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %] > var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field %]",[% END %]]; >@@ -1209,7 +1210,10 @@ $(document).ready(function() { > }); > if( $("#memberentry_guarantor").length ) { > $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0); >+ $("#quick_add_form #memberentry_guarantor").append("<p>" + _("Note: Quick add guarantor form populates address fields in full form") + "</p>"); >+ $("#quick_add_list #guarantordelete").prop('id','qagd'); > } >+ $("#qagd").click(function() { $("#guarantordelete").click(); }); > $("#quick_add_form").show(); > }); > </script> >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('<a target="blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + id + '">' + id + '</a>'); >@@ -200,9 +200,11 @@ function select_user(borrowernumber, borrower) { > $(form.contactname) > .val(borrower.surname) > .before('<span>' + borrower.surname + '</span>').get(0).type = 'hidden'; >- $(form.contactfirstname) >+ $("#quick_add_form #contactname").val(borrower.surname).before('<span>'+borrower.surname+'</span.').attr({type:"hidden"}); >+ $(form.contactfirstname,"#quick_add_form #contactfirstname") > .val(borrower.firstname) > .before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden'; >+ $("#quick_add_form #contactfirstname").val(borrower.firstname).before('<span>'+borrower.firstname+'</span.').attr({type:"hidden"}); > > form.streetnumber.value = borrower.streetnumber; > form.address.value = borrower.address; >@@ -213,7 +215,17 @@ function select_user(borrowernumber, borrower) { > form.country.value = borrower.country; > form.branchcode.value = borrower.branchcode; > >+ $("quick_add_form #streetnumber").val(borrower.streetnumber); >+ $("quick_add_form #address").val(borrower.address); >+ $("quick_add_form #address2").val(borrower.address2); >+ $("quick_add_form #city").val(borrower.city); >+ $("quick_add_form #state").val(borrower.state); >+ $("quick_add_form #zipcode").val(borrower.zipcode); >+ $("quick_add_form #country").val(borrower.country); >+ $("quick_add_form #branchcode").val(borrower.branchcode); >+ > form.guarantorsearch.value = LABEL_CHANGE; >+ $("#quick_add_form #guarantorsearch").val(LABEL_CHANGE); > > return 0; > } >@@ -286,14 +298,14 @@ $(document).ready(function(){ > }); > > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >- > $("#guarantordelete").click(function() { >- $("#contact-details").hide().find('a').remove(); >- $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = ""; }); >- $("#contactname, #contactfirstname") >+ $("#quick_add_form #contact-details,#contact-details").hide().find('a').remove(); >+ $("#quick_add_form #guarantorid,#quick_add_form #contactname,#quick_add_form #contactfirstname, #guarantorid,#contactname,#contactfirstname").each(function () { this.value = ""; }); >+ $("#quick_add_form #contactname, #quick_add_form #contactfirstname,#contactname,#contactfirstname") > .each(function () { this.type = 'text'; }) > .parent().find('span').remove(); >- $("#guarantorsearch").val(LABEL_SET_TO_PATRON); >+ $("#quick_add_form #guarantorsearch,#guarantorsearch").val(LABEL_SET_TO_PATRON); >+ $("quick_add_form #guarantorsearch,#guarantorsearch").val(LABEL_SET_TO_PATRON); > }); > > $("#select_city").change(function(){ >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17344
:
57674
|
57678
|
57705
|
57708
|
57709