From ec630b4b6c9949a51e8491c0c8b3e30d3a43df50 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 26 Jun 2020 18:51:15 +0000 Subject: [PATCH] Bug 25879: Improve display of guarantor information in the patron entry form This patch makes some changes to the patron entry template to improve the display of guarantor information. To test, apply the patch and locate a patron with a "Child" type category. - Edit the patron's record - Under "Guarantor information," click the "Search to add" button. - Search for and select a patron. - The guarantor information should be added to the patron edit form. The information should be correct and well formatted. - Click the "Remove" link. The guarantor information should be removed. - Search for an select a guarantor again and save the record. - Edit the patron record again. The saved guarantor information should look correct. Looks great! Signed-off-by: Caroline Cyr La Rose Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/memberentrygen.tt | 70 +++++-------------- koha-tmpl/intranet-tmpl/prog/js/members.js | 1 + 2 files changed, 20 insertions(+), 51 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 0014a0f612..e0e8902c52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -407,45 +407,30 @@ legend:hover { [% IF show_guarantor || guarantor %] [% SET possible_relationships = Koha.Preference('borrowerRelationship') %] - +
Guarantor information - +
[% FOREACH r IN relationships %] -
+
    [% IF category_type == 'I' %]
  1. - Organization #: [% IF ( r.guarantor_id ) %] [% r.guarantor_id | html %][% END %] + Organization: + [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
  2. -
  3. - - [% r.guarantor.surname | html %] + Relationship: + [% r.relationship | html %]
  4. [% ELSE %]
  5. - Patron card number: - [% r.guarantor.cardnumber | html %] + Guarantor: + [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
  6. - - [% IF r.guarantor.surname %] -
  7. - - [% r.guarantor.surname | html %] -
  8. - [% END %] - - [% IF r.guarantor.firstname %] -
  9. - - [% r.guarantor.firstname | html %] -
  10. - [% END %] -
  11. - + Relationship: [% r.relationship | html %]
  12. @@ -466,16 +451,6 @@ legend:hover { -
  13. - - [% guarantor.surname | html %] -
  14. - -
  15. - - [% guarantor.firstname | html %] -
  16. -
  17. [% UNLESS empty_relationship_allowed %] @@ -503,26 +478,19 @@ legend:hover {
[% END %] - +
-
+
  1. - Patron card number: - + Guarantor: + + + () +
  2. -
  3. - - -
  4. - -
  5. - - -
  6. -
  7. [% UNLESS empty_relationship_allowed %] @@ -545,7 +513,7 @@ legend:hover {
  8. - Remove + Remove
@@ -591,7 +559,7 @@ legend:hover { [% END %]
-
+
[% END # /IF show_guarantor || guarantor %] [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js index 1e102f1be7..4de6e6e198 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members.js @@ -182,6 +182,7 @@ function select_user(borrowernumber, borrower, relationship) { if ( guarantor_id ) { fieldset.find('.new_guarantor_id').first().val( guarantor_id ); fieldset.find('.new_guarantor_id_text').first().text( borrower.cardnumber ); + fieldset.find('.new_guarantor_link').first().attr("href", "/cgi-bin/koha/members/moremember.pl?borrowernumber=" + guarantor_id ); } else { fieldset.find('.guarantor_id').first().hide(); }