Bug 23808 - Creating Child Guarantee doesn't populate Guarantor Information
Summary: Creating Child Guarantee doesn't populate Guarantor Information
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Alex Buckley
QA Contact: Testopia
URL:
Keywords:
: 25738 25739 25741 (view as bug list)
Depends on:
Blocks: 22534 24942
  Show dependency treegraph
 
Reported: 2019-10-13 12:55 UTC by Kelly McElligott
Modified: 2021-06-14 21:31 UTC (History)
12 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.07


Attachments
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (4.30 KB, patch)
2020-03-17 03:23 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (9.46 KB, patch)
2020-03-17 03:30 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (11.54 KB, patch)
2020-03-17 03:59 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (5.70 KB, patch)
2020-03-17 04:52 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: Added missing filter (1.58 KB, patch)
2020-03-17 05:56 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (6.90 KB, patch)
2020-03-17 06:56 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (6.97 KB, patch)
2020-03-17 13:20 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (7.19 KB, patch)
2020-03-17 14:40 UTC, George Veranis
Details | Diff | Splinter Review
Bug 23808: (follow-up) Display card number in 'Guarantor information' in memberentry.pl (6.11 KB, patch)
2020-03-17 21:26 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: (follow-up) Display card number in 'Guarantor information' in memberentry.pl (7.56 KB, patch)
2020-03-18 00:08 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: (follow-up) Pre-fill guarantee's contact details from guarantor patron in memberentry.pl (7.57 KB, patch)
2020-03-18 00:10 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 23808: (follow-up) Display card number in 'Guarantor information' in memberentry.pl (6.17 KB, patch)
2020-03-18 14:08 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 23808: (follow-up) Pre-fill guarantee's contact details from guarantor patron in memberentry.pl (7.62 KB, patch)
2020-03-18 14:08 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 23808: Pre-fill guarantor fields when adding guarantee to guarantor (7.26 KB, patch)
2020-03-20 13:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23808: (follow-up) Display card number in 'Guarantor information' in memberentry.pl (6.27 KB, patch)
2020-03-20 13:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23808: (follow-up) Pre-fill guarantee's contact details from guarantor patron in memberentry.pl (7.80 KB, patch)
2020-03-20 13:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23808: (follow-up) Object methods can be used directly, no need for unblessed (1.65 KB, patch)
2020-03-20 13:01 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23808: [19.11.x] Pre-fill guarantor fields when adding guarantee to guarantor (15.04 KB, patch)
2020-06-05 01:03 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kelly McElligott 2019-10-13 12:55:52 UTC
This is happening on 18.11.06:

In this process, creating child guarantee does not populate Guarantor Information:
1. Create an Adult Patron
2. Create a New Patron - choosing a Child category
3. Add Surname, First Name, search for Guarantor in database- choose Guarantor.
4. Guarantor's address does not populate for Child Account.



The way to do this which does work:
1. Create an Adult Patron
2. Click Add Child from Adult Patron's form.
3. Add surname, First name of Child
4. See the Guarantor's address is populated already.


Can we adjust it so the first way works as the second way does?
Comment 1 George Veranis 2020-03-08 01:07:24 UTC
That happen as a side-effect of bug 14570 "Make it possible to add multiple guarantors to a record" . The truth is when we have only one guarantor would be helpful to have some fields pre-filled.
Comment 2 Alex Buckley 2020-03-17 03:23:00 UTC Comment hidden (obsolete)
Comment 3 Alex Buckley 2020-03-17 03:30:48 UTC Comment hidden (obsolete)
Comment 4 Alex Buckley 2020-03-17 03:59:55 UTC Comment hidden (obsolete)
Comment 5 Alex Buckley 2020-03-17 04:52:37 UTC Comment hidden (obsolete)
Comment 6 Alex Buckley 2020-03-17 04:56:00 UTC
Hi all, 

I have replicated the bug behaviour George mentioned in comment #1 on master. Which is slightly different to what Kelly mentioned in 'Description'.

Currently in master if you 'Add guarantee' from Adult's patron form then the guarantor/adults details are not pre-filled in the 'Guarantor information' section of memberentry.pl

I've written a patch fix to solve that. 

Please have a test and let me know how you get on.

Thanks,
Alex
Comment 7 Alex Buckley 2020-03-17 05:56:18 UTC Comment hidden (obsolete)
Comment 8 Alex Buckley 2020-03-17 06:56:57 UTC
Created attachment 100845 [details] [review]
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
Comment 9 Alex Buckley 2020-03-17 06:57:25 UTC
Sorry for the noise on this ticket with the patch fixes. I think it's finally ready to test :)
Comment 10 Andrew Fuerste-Henry 2020-03-17 13:20:22 UTC
Created attachment 100889 [details] [review]
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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 11 George Veranis 2020-03-17 14:40:33 UTC
Created attachment 100900 [details] [review]
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 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.
Comment 12 Andreas Roussos 2020-03-17 17:09:27 UTC
Would it make sense to reword the somewhat ambiguous "Patron #:" bit to read
"Patron card number:" and also change the hyperlink to print the card number
instead of the borrowernumber (leaving the link destination pointing to the
borrowernumber)? From the point of view that it makes more sense for a Staff
Interface user to view patrons' card numbers instead of a borrowernumber which
is just a primary key in the DB and conveys little meaning to a regular user.
Comment 13 Alex Buckley 2020-03-17 21:26:03 UTC
Created attachment 100925 [details] [review]
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
Comment 14 Alex Buckley 2020-03-17 21:26:43 UTC
Hi all, 

Thanks very much everyone for testing!

I agree Andreas displaying the card number would be more useful to librarians. I have attached a follow-up patch which does that. 

Please test and let me know what you think :)

Many thanks,
Alex
Comment 15 Alex Buckley 2020-03-18 00:08:14 UTC Comment hidden (obsolete)
Comment 16 Alex Buckley 2020-03-18 00:10:32 UTC
Created attachment 100929 [details] [review]
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
Comment 17 Andreas Roussos 2020-03-18 14:08:15 UTC
Created attachment 100957 [details] [review]
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>
Comment 18 Andreas Roussos 2020-03-18 14:08:18 UTC
Created attachment 100958 [details] [review]
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>
Comment 19 Andreas Roussos 2020-03-18 14:15:01 UTC
Alex, many thanks for following up on this so quickly! I have tested your new
patches and they look good to me, so I signed them off.

I also took the liberty of tagging some of the comments as obsolete, in order
to unclutter the flow of the discussion in this bug report.
Comment 20 Alex Buckley 2020-03-18 21:32:35 UTC
Thanks very much Andreas!
Comment 21 Kyle M Hall 2020-03-20 13:01:45 UTC
Created attachment 101098 [details] [review]
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 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>
Comment 22 Kyle M Hall 2020-03-20 13:01:53 UTC
Created attachment 101099 [details] [review]
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>
Comment 23 Kyle M Hall 2020-03-20 13:01:56 UTC
Created attachment 101100 [details] [review]
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>
Comment 24 Kyle M Hall 2020-03-20 13:01:59 UTC
Created attachment 101101 [details] [review]
Bug 23808: (follow-up) Object methods can be used directly, no need for unblessed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 25 Martin Renvoize 2020-03-20 15:43:26 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 26 Alex Buckley 2020-03-22 19:34:00 UTC
Thanks very much everyone!
Comment 27 Joy Nelson 2020-04-03 21:05:35 UTC
does not apply to 19.11.x.  please rebase if needed.
Comment 28 Nick Clemens 2020-06-05 01:03:59 UTC
Created attachment 105565 [details] [review]
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
Comment 29 Kelly McElligott 2020-06-05 15:13:48 UTC
I have tested this as we are hoping to have this rebase to happen so it can get pushed to 19.11. 
It is working!
Comment 30 Kelly McElligott 2020-06-12 21:32:40 UTC
*** Bug 25738 has been marked as a duplicate of this bug. ***
Comment 31 Aleisha Amohia 2020-06-15 22:33:18 UTC
backported to 19.11.x for 19.11.07
Comment 32 Victor Grousset/tuxayo 2020-06-17 22:01:58 UTC
Won't be backported to oldoldstable (19.05.x) considering it's severity (the level + a subjective perception) is not high enough and the patch is a bit to large.

Unless there is a special need about this and some help to test it.
Comment 33 Katrin Fischer 2020-07-13 20:55:19 UTC
*** Bug 25741 has been marked as a duplicate of this bug. ***
Comment 34 Katrin Fischer 2020-09-20 23:26:41 UTC
*** Bug 25739 has been marked as a duplicate of this bug. ***