From 27cce6efae603b39921a295e624fc4f831ab28f3 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 26 Jun 2020 20:12:58 +0000 Subject: [PATCH] Bug 25654: Make the contact and non-patron guarantor sections separate on patron entry form This patch reverses what I think was an unintended change made by Bug 14570 in which the non-patron guarantor fields are shown for all patron types (not just child patrons) and grouped with the patron contact fields. This patch creates a new "Non-patron guarantor" fieldset to show along with "Patron guarantor" when adding or editing child patrons. To test, apply the patch check that the BorrowerUnwantedField system preference does not contain contactname, contactfirstname, or relationship. - Open an adult patron for editing. You should see no guarantor-related fields. - Open a child patron for editing. There should be two guarantor sections: "Patron guarantor" and "Non-patron guarantor." - Test that adding patron guarantors and non-patron guarantors works correctly. - Add "contactname|contactfirstname|relationship" to the BorrowerUnwantedField system preference. - Reload the child patron entry form. The non-patron guarantor section should now be hidden. --- .../prog/en/modules/members/memberentrygen.tt | 113 +++++++++++---------- 1 file changed, 60 insertions(+), 53 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 25c32db057..6ff91af939 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -409,7 +409,7 @@ legend:hover { [% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
- Guarantor information + Patron guarantor [% FOREACH r IN relationships %] @@ -570,6 +570,65 @@ legend:hover {
+ + [% UNLESS nocontactname && nocontactfirstname && norelationship %] +
+ Non-patron guarantor +
    + [% UNLESS nocontactname %] +
  1. + [% IF ( mandatorycontactname ) %] +
  2. + [% END # /UNLESS nocontactname %] + + [% UNLESS nocontactfirstname %] +
  3. + [% IF ( mandatorycontactfirstname ) %] +
  4. + [% END # /UNLESS noaltcontactfirstname %] + + [% UNLESS norelationship %] + [% IF possible_relationships %] +
  5. + + +
  6. + [% END #/IF possible_relationships %] + [% END # /UNLESS norelationship %] +
+
+ [% END # /UNLESS nocontactname && nocontactfirstname && norelationship %] [% END # /IF show_guarantor || guarantor %] [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %] @@ -580,58 +639,6 @@ legend:hover {
Contact
    - [% UNLESS nocontactname %] -
  1. - [% IF ( mandatorycontactname ) %] -
  2. - [% END # /UNLESS nocontactname %] - - [% UNLESS nocontactfirstname %] -
  3. - [% IF ( mandatorycontactfirstname ) %] -
  4. - [% END # /UNLESS noaltcontactfirstname %] - - [% UNLESS norelationship %] - [% IF possible_relationships %] -
  5. - - -
  6. - [% END #/IF possible_relationships %] - [% END # /UNLESS norelationship %] - [% UNLESS nophone %]
  7. [% IF ( mandatoryphone ) %] -- 2.11.0