Bugzilla – Attachment 95818 Details for
Bug 23905
Button "Search to add" doesn't work on Quick add new patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23905: Button "Search to add" doesn't work on Quick add new patron
Bug-23905-Button-Search-to-add-doesnt-work-on-Quic.patch (text/plain), 5.97 KB, created by
Martin Renvoize (ashimema)
on 2019-11-26 11:16:28 UTC
(
hide
)
Description:
Bug 23905: Button "Search to add" doesn't work on Quick add new patron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-26 11:16:28 UTC
Size:
5.97 KB
patch
obsolete
>From dcb9bf358151bcca6189581871aeb937125bc896 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 25 Nov 2019 11:50:46 -0500 >Subject: [PATCH] Bug 23905: Button "Search to add" doesn't work on Quick add > new patron > >This issue is caused by duplicating the patron guarantor fieldset. >The solution is to move it between the two forms insetad. >In addition, this patch moves the guarantor information fieldset to the area below the "Quick add" fieldset, instead of *inside* it. This change preserves the correct styling and layout of the Guarantor information fieldset whilst it is moved back and forth by the "quick add"/"full form" toggle. > >Test Plan: >1) Quick add a child patron >2) Attempt to use the "Search to add" button >3) Note it does nothing >4) Apply this patch >5) Repeat steps 1 and 2 >6) It works now! >7) Test toggling between the quick add and full form views, > note the "Guarantor information" fieldset shows correctly > in the full form view. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/members/memberentrygen.tt | 18 ++++++++++-------- > koha-tmpl/intranet-tmpl/prog/js/members.js | 4 +--- > 2 files changed, 11 insertions(+), 11 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 f36d98314b..71bfab77bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -320,6 +320,7 @@ > > [% IF show_guarantor || guarantor %] > [% SET possible_relationships = Koha.Preference('borrowerRelationship') %] >+ <span id="memberentry_guarantor_anchor"> > <fieldset id="memberentry_guarantor" class="rows"> > <legend>Guarantor information</legend> > >@@ -357,6 +358,7 @@ > [% END %] > > <li> >+ </span> > <label for="relationship">Relationship: </label> > <span>[% r.relationship | html %]</span> > </li> >@@ -446,6 +448,7 @@ > [% END %] > </ol> > </fieldset> >+ </span> > [% END %] > > >@@ -1273,9 +1276,11 @@ > if( $("#entryform:visible").length ) { > toggle_to = "#quick_add_form label"; > toggle_from = "#entryform label"; >+ $("#memberentry_guarantor").appendTo("#quick_add_form"); > } else { > toggle_to="#entryform label"; > toggle_from = "#quick_add_form label"; >+ $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor"); > } > $(toggle_from).each(function() { > var input_label = $(this).attr('for'); >@@ -1293,6 +1298,7 @@ > $("#quick_add_form").validate(); > if( $("#quick_add_form").valid()){ > $('.toggle_quick_add').click(); >+ $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor"); > $('#saverecord').click(); > } > else {return false;} >@@ -1340,7 +1346,6 @@ > $("#entryform,#saverecord").hide(); > [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %] > var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]]; >- var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields > $("#entryform label").each(function () { > var input_label = $(this).attr('for'); > if ( input_label == 'sex-female' ) { >@@ -1349,7 +1354,6 @@ > else if ( input_label == 'btitle' ) { > input_label='title'; > } >- if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; } > if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){ > $(this).parent().clone().appendTo("#quick_add_list"); > [% UNLESS mandatorypassword %] >@@ -1357,15 +1361,13 @@ > [% END %] > } > }); >- 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(); }); >+ if ( $("#memberentry_guarantor").length ) { >+ $("#memberentry_guarantor").appendTo("#quick_add_form"); >+ } > $("#quick_add_form").show(); > }); > [% END %] >+ $("#guarantor_template").hide(); > > </script> > [% Asset.js("js/members.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 3579dbeed5..ec2d58d8a2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -281,9 +281,7 @@ $(document).ready(function(){ > > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); > >- $('#guarantor_template').hide(); >- >- $('#guarantor_search').on('click', function(e) { >+ $('body').on('click', '#guarantor_search', function(e) { > e.preventDefault(); > var newin = window.open('guarantor_search.pl','popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top'); > }); >-- >2.20.1
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 23905
:
95798
|
95800
|
95803
|
95804
|
95812
|
95813
| 95818 |
95819