From 8245bc6f2de7276d7e98788b115e3b983c915941 Mon Sep 17 00:00:00 2001 From: Petro Vashchuk Date: Tue, 30 Mar 2021 14:42:11 +0300 Subject: [PATCH] Bug 25946: borrowerRelationship can be empty Do not show the empty dropdown with no options if borrowerRelationship is disabled (empty) in the syspref. To reproduce: 1) Go to system preferences and disable borrowerRelationship. 2) Create a new patron or modify the existing one. 3) Under "Guarantor Information" click on "Search to add" button. After performing the search, select different patron to act as guarantor. 4) Observe that there's empty dropdown for the relation type. 5) Apply the patch. 6) Repeat steps above. 7) Observe that dropdown is no longer there. Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/memberentrygen.tt | 76 ++++++++++--------- 1 file changed, 42 insertions(+), 34 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 e63e97e347..643d4b9a46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -457,25 +457,29 @@ legend:hover { -
  • - [% UNLESS empty_relationship_allowed %] - - - [% END %] - - [% FOREACH pr IN possible_relationships.split('\|') %] - [% IF pr != "" %] - + [% IF possible_relationships %] +
  • + [% UNLESS empty_relationship_allowed %] + + + [% END %] + + [% FOREACH pr IN possible_relationships.split('\|') %] + [% IF pr != "" %] + + [% END %] [% END %] + + [% UNLESS empty_relationship_allowed %] + Required [% END %] - - [% UNLESS empty_relationship_allowed %] - Required - [% END %] -
  • + + [% ELSE %] + + [% END %]
  • @@ -497,25 +501,29 @@ legend:hover {
  • -
  • - [% UNLESS empty_relationship_allowed %] - - - [% END %] - - [% FOREACH pr IN possible_relationships.split('\|') %] - [% IF pr != "" %] - + [% IF possible_relationships %] +
  • + [% UNLESS empty_relationship_allowed %] + + + [% END %] + + [% FOREACH pr IN possible_relationships.split('\|') %] + [% IF pr != "" %] + + [% END %] [% END %] + + [% UNLESS empty_relationship_allowed %] + Required [% END %] - - [% UNLESS empty_relationship_allowed %] - Required - [% END %] -
  • + + [% ELSE %] + + [% END %]
  • -- 2.39.5