Bugzilla – Attachment 100845 Details for
Bug 23808
Creating Child Guarantee doesn't populate Guarantor Information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor
Bug-23808-Pre-fill-guarantor-fields-when-adding-gu.patch (text/plain), 6.90 KB, created by
Alex Buckley
on 2020-03-17 06:56:57 UTC
(
hide
)
Description:
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2020-03-17 06:56:57 UTC
Size:
6.90 KB
patch
obsolete
>From 9a28c548d44ba142e47c1f34efeab084841aac21 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Tue, 17 Mar 2020 04:50:32 +0000 >Subject: [PATCH] Bug 23808: Pre-fill guarantor fields when adding guarantee to > guarantor > >Bug 14570 removed the guarantor pre-fill functionality when selecting >'Add guarantee' to an Adult patron. This is because guarantor >information would now only display if (1) the patron record exists >(which it won't when first adding guarantee to guarantor record) and (2) >if there is already a guarantor added to a guarantee > >This patchfix will pre-fill guarantor fields and address fields (so the guarantee >has the same address as the guarantor) if no relationship (existing >guarantor data exists) and a guarantor_id is handed to memberenty.pl in >URL when clicking 'Add guarantee' button on Adults patron record. > >Test plan: >1. Add adult patron make sure to fill in their 'Main address' details >2. Select 'Add guarantee' >3. Observe no details of the adult patron >are displaying in the 'Guarantor information' section or 'Main address' >sections of memberentry.pl > >4. Select 'Search to add', search for your adult patron and choose >'Select' to add them as guarantor > >5. Fill out rest of memberentry.pl and 'Save' > >6. Observe adult is showing as the guarantor > >7. Apply patch > >8. Run tests: >sudo koha-shell <instancename> >prove xt >prove t > >9. Confirm tests pass > >10. Return to your adult patron > >11. Select 'Add guarantee' > >12. Observe in 'Guarantor information' and 'Main address' sections of memberentry.pl >are pre-filled with the 'patron #' (borrowernumber), surname, firstname >and street number, address, address2 (if you filled that in on adults >account), city > >13. Fill out the rest of memberenty.pl and save and confirm your adult >patron is showing as the guarantor and the pre-filled address details >have been saved and are showing > >14. Repeat steps 10,11 and 12 and in the 'Guarantor information' select >'Search to add' and add another adult as guarantor > >15. Fill out the rest of memberentry.pl and 'Save' and notice with this >patch applied you can still add multiple guarantors successfully > >Sponsored-By: South Taranaki Distict Council, NZ >--- > .../prog/en/modules/members/memberentrygen.tt | 35 ++++++++++++++++++++++ > members/memberentry.pl | 9 ++++++ > 2 files changed, 44 insertions(+) > >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 d4db2e37b3..283ead7699 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -417,6 +417,41 @@ > </ol> > </fieldset> > [% END # END relationships foreach %] >+ [% IF guarantor && (!relationships) %] >+ <fieldset class="rows"> >+ <ol> >+ <li class="guarantor-details" data-borrowernumber="0"> >+ <span class="label">Patron #:</span> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank">[% guarantor.borrowernumber | html %]</a> >+ <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/> >+ </li> >+ >+ <li> >+ <label for="guarantor_surname">Surname: </label> >+ <span class="new_guarantor_surname_text">[% guarantor.surname | html %]</span> >+ </li> >+ >+ <li> >+ <label for="guarantor_firstname">First name: </label> >+ <span class="new_guarantor_firstname_text">[% guarantor.firstname | html %]</span> >+ </li> >+ >+ <li> >+ <label for="guarantor_relationship">Relationship: </label> >+ <select class="new_guarantor_relationship" name="new_guarantor_relationship"> >+ [% FOREACH pr IN possible_relationships.split('\|') %] >+ <option value="[% pr | html %]">[% pr | html %]</option> >+ [% END %] >+ </select> >+ </li> >+ >+ <li> >+ <label for="guarantor_cancel"> </label> >+ <span><a href="#" class="guarantor_cancel">Remove</a></span> >+ </li> >+ </ol> >+ </fieldset> >+ [% END %] > </span> <!-- #/guarantor_relationships --> > > <fieldset class="rows guarantor" id="guarantor_template"> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 902beeb0e8..1e8241d985 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -594,6 +594,15 @@ if (C4::Context->preference("IndependentBranches")) { > } > } > if ($op eq 'add'){ >+ if ( $guarantor_id ) { >+ my $guarantordata = $guarantor->unblessed; >+ foreach (qw(streetnumber address streettype address2 >+ zipcode country city state phone phonepro mobile fax email emailpro branchcode >+ B_streetnumber B_streettype B_address B_address2 >+ B_city B_state B_zipcode B_country B_email B_phone)) { >+ $newdata{$_} = $guarantordata->{$_}; >+ } >+ } > $template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1); > } > if ($op eq "modify") { >-- >2.11.0
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 23808
:
100839
|
100840
|
100841
|
100842
|
100844
|
100845
|
100889
|
100900
|
100925
|
100928
|
100929
|
100957
|
100958
|
101098
|
101099
|
101100
|
101101
|
105565