Bugzilla – Attachment 105565 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: [19.11.x] Pre-fill guarantor fields when adding guarantee to guarantor
Bug-23808-1911x-Pre-fill-guarantor-fields-when-add.patch (text/plain), 15.04 KB, created by
Nick Clemens (kidclamp)
on 2020-06-05 01:03:59 UTC
(
hide
)
Description:
Bug 23808: [19.11.x] Pre-fill guarantor fields when adding guarantee to guarantor
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-06-05 01:03:59 UTC
Size:
15.04 KB
patch
obsolete
>From b7c56ca7e3446f2a6411065c46b0a4447ef639ef 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: [19.11.x] 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 District Council, NZ > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Signed-off-by: George Veranis <gveranis@dataly.gr> >Followed the test plan, works as expected. The only failure was >t/DateUtils.t test which will be fixed by Bug 24850. >Also corrected a small typo in the sponsored-by trailer. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Bug 23808: (follow-up) Display card number in 'Guarantor information' in memberentry.pl > >Instead of displaying 'Patron #' and displaying the guarantor's borrowernumber >in 'Guarantor information' we should display 'Patron card number:' with >the cardnumber displayed as that value is more meaningful to librarians. >The hyperlink containing the borrowernumber should stay the same so that >librarians can easily visit the patron record of existing guarantor >patrons. > >Test plan: > >1. Apply first patch and follow it's test plan > >2. On an Adult patrons record select 'Add guarantee' > >3. In 'Guarantor information' section of memberentry.pl observe in the >pre-filled guarantor information there is >a line 'Patron #:' with a link displaying a borrowernumber (not card number) and when you click on the link it takes you to the adult/guarantors patron account > >4. Select 'Search to add' and search and add another guarantor > >5. Observe in the added guarantor 'Patron #:' is displayed along with >the borrowernumber (not card number). The borrowernumber displayed in >not a link. > >6. Apply this patch > >7. On a adults patron select 'Add guarantee' > >8. Observe in 'Guarantor information' section the pre-filled guarantor >now has 'Patron card number:' displayed (instead of 'Patron #:', and it's link now displays the guarantors cardnumber. >Clicking on the link still takes you to the guarantors patron account > >9. Repeat step 4 > >10. Observe in the added guarantor they also have 'Patron card number:' >(instead of 'Patron #:'). A cardnumber rather than borrowernumber is >displayed. The cardnumber is not a link. > >11. Confirm tests still pass: >sudo koha-shell <instancename> >prove xt >prove t > >Sponsored-by: South Taranaki District Council, NZ >Signed-off-by: Andreas Roussos <a.roussos@dataly.gr> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Bug 23808: (follow-up) Pre-fill guarantee's contact details from guarantor patron in memberentry.pl > >Pre-fill guarantee contact details (email, phone) from guarantor record >when adding a gurantee to a guarantor's record > >Test plan: > >1. Apply first two patches and follow test plans > >2. On an adult's patron record (which has an primary phone >number, secondary phone, other phone, primary email, secondary email and >fax set) select 'Add a guarantee' and observe the guarantee's 'Contact' >section is not pre-filled with that information from the guarantor > >3. Apply this patch > >4. On the same adult's record select 'Add a guarantee' and observe that >the 'Primary phone', 'Secondary phone', 'Other phone', 'Primary email', >'Secondary email', 'Fax' have been pre-filled from the guarantor's >record > >5. Fill out the rest of the memberentry.pl and 'Save' and observe that those contact >details are successfully saved > >6. Repeat step 4 and alter the 'Primary phone' and 'Primary email' >fields and save and observe that those altered values are saved > >7. Run tests and confirm they pass: >sudo koha-shell <instancename> >prove xt >prove t > >Sponsored-by: South Taranaki District Council, NZ >Signed-off-by: Andreas Roussos <a.roussos@dataly.gr> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Bug 23808: (follow-up) Object methods can be used directly, no need for unblessed > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >fix tabs >--- > .../prog/en/modules/members/memberentrygen.tt | 57 +++++++++++++++++----- > koha-tmpl/intranet-tmpl/prog/js/members.js | 2 +- > members/memberentry.pl | 13 +++++ > 3 files changed, 60 insertions(+), 12 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 558c69c543..19b9c2d2a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -352,8 +352,8 @@ > </li> > [% ELSE %] > <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]"> >- <span class="label">Patron #:</span> >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor_id | html %]</a> >+ <span class="label">Patron card number:</span> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor.cardnumber | html %]</a> > </li> > > [% IF r.guarantor.surname %] >@@ -383,12 +383,47 @@ > </ol> > </fieldset> > [% END # END relationships foreach %] >+ [% IF guarantor && (!relationships) %] >+ <fieldset class="rows"> >+ <ol> >+ <li class="guarantor-details" data-borrowernumber="0"> >+ <span class="label">Patron card number:</span> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank">[% guarantor.cardnumber | 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> > > <fieldset class="rows guarantor" id="guarantor_template"> > <ol> > <li class="guarantor-details" data-borrowernumber="0"> >- <span class="label">Patron #:</span> >+ <span class="label">Patron card number:</span> > <span class="new_guarantor_id_text"></span> > <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/> > </li> >@@ -484,7 +519,7 @@ > <label for="contactname"> > [% END %] > Guarantor surname: </label> >- <input type="text" id="contactname" name="contactname" value="[% contactname | html %]" /> >+ <input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" /> > [% IF ( mandatorycontactname ) %]<span class="required">Required</span>[% END %]<div class="hint">Non-patron guarantor surname</div> > </li> > [% END %] >@@ -497,7 +532,7 @@ > <label for="contactfirstname"> > [% END %] > Guarantor first name: </label> >- <input type="text" id="contactfirstname" name="contactfirstname" value="[% contactfirstname | html %]" /> >+ <input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" /> > [% IF ( mandatorycontactfirstname ) %]<span class="required">Required</span>[% END %]<div class="hint">Non-patron guarantor first name</div> > </li> > [% END %] >@@ -528,7 +563,7 @@ > <label for="phone"> > [% END %] > Primary phone: </label> >- <input type="text" id="phone" name="phone" value="[% phone | html %]" /> >+ <input type="text" id="phone" name="phone" value="[% patron.phone | html %]" /> > [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div> > </li> > [% END %] >@@ -541,7 +576,7 @@ > <label for="phonepro"> > [% END %] > Secondary phone: </label> >- <input type="text" id="phonepro" name="phonepro" value="[% phonepro | html %]" /> >+ <input type="text" id="phonepro" name="phonepro" value="[% patron.phonepro | html %]" /> > [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -554,7 +589,7 @@ > <label for="mobile"> > [% END %] > Other phone: </label> >- <input type="text" id="mobile" name="mobile" value="[% mobile | html %]" /> >+ <input type="text" id="mobile" name="mobile" value="[% patron.mobile | html %]" /> > [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -567,7 +602,7 @@ > <label for="email"> > [% END %] > Primary email: </label> >- <input type="text" id="email" name="email" size="45" value="[% email | html %]" /> >+ <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" /> > [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div> > </li> > [% END %] >@@ -580,7 +615,7 @@ > <label for="emailpro"> > [% END %] > Secondary email: </label> >- <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro | html %]" /> >+ <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" /> > [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >@@ -593,7 +628,7 @@ > <label for="fax"> > [% END %] > Fax: </label> >- <input type="text" id="fax" name="fax" value="[% fax | html %]" /> >+ <input type="text" id="fax" name="fax" value="[% patron.fax | html %]" /> > [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index da7d47e26d..1e102f1be7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -181,7 +181,7 @@ function select_user(borrowernumber, borrower, relationship) { > var guarantor_id = $('#guarantor_id').val(); > if ( guarantor_id ) { > fieldset.find('.new_guarantor_id').first().val( guarantor_id ); >- fieldset.find('.new_guarantor_id_text').first().text( guarantor_id ); >+ fieldset.find('.new_guarantor_id_text').first().text( borrower.cardnumber ); > } else { > fieldset.find('.guarantor_id').first().hide(); > } >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 2fbf25fd82..488c4e70aa 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -612,6 +612,19 @@ if (C4::Context->preference("IndependentBranches")) { > } > } > if ($op eq 'add'){ >+ if ($guarantor_id) { >+ 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{$_} = $guarantor->$_; >+ } >+ } > $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