Browse Source

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 <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Petro Vashchuk 2 years ago
committed by Jonathan Druart
parent
commit
8245bc6f2d
  1. 76
      koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt

76
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt

@ -457,25 +457,29 @@ legend:hover {
<input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/>
</li>
<li>
[% UNLESS empty_relationship_allowed %]
<label for="guarantor_relationship" class="required">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
[% ELSE %]
<label for="guarantor_relationship">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship">
[% END %]
<option value="" selected>Empty option</option>
[% FOREACH pr IN possible_relationships.split('\|') %]
[% IF pr != "" %]
<option value="[% pr | html %]">[% pr | html %]</option>
[% IF possible_relationships %]
<li>
[% UNLESS empty_relationship_allowed %]
<label for="guarantor_relationship" class="required">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
[% ELSE %]
<label for="guarantor_relationship">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship">
[% END %]
<option value="" selected>Empty option</option>
[% FOREACH pr IN possible_relationships.split('\|') %]
[% IF pr != "" %]
<option value="[% pr | html %]">[% pr | html %]</option>
[% END %]
[% END %]
</select>
[% UNLESS empty_relationship_allowed %]
<span class="required">Required</span>
[% END %]
</select>
[% UNLESS empty_relationship_allowed %]
<span class="required">Required</span>
[% END %]
</li>
</li>
[% ELSE %]
<input type="hidden" name="new_guarantor_relationship" value="" />
[% END %]
<li>
<label for="guarantor_cancel">&nbsp;</label>
@ -497,25 +501,29 @@ legend:hover {
<input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/>
</li>
<li>
[% UNLESS empty_relationship_allowed %]
<label for="guarantor_relationship" class="required">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
[% ELSE %]
<label for="guarantor_relationship">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship">
[% END %]
<option value="" selected></option>
[% FOREACH pr IN possible_relationships.split('\|') %]
[% IF pr != "" %]
<option value="[% pr | html %]">[% pr | html %]</option>
[% IF possible_relationships %]
<li>
[% UNLESS empty_relationship_allowed %]
<label for="guarantor_relationship" class="required">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
[% ELSE %]
<label for="guarantor_relationship">Relationship: </label>
<select class="new_guarantor_relationship" name="new_guarantor_relationship">
[% END %]
<option value="" selected></option>
[% FOREACH pr IN possible_relationships.split('\|') %]
[% IF pr != "" %]
<option value="[% pr | html %]">[% pr | html %]</option>
[% END %]
[% END %]
</select>
[% UNLESS empty_relationship_allowed %]
<span class="required">Required</span>
[% END %]
</select>
[% UNLESS empty_relationship_allowed %]
<span class="required">Required</span>
[% END %]
</li>
</li>
[% ELSE %]
<input type="hidden" name="new_guarantor_relationship" value="" />
[% END %]
<li>
<label for="guarantor_cancel">&nbsp;</label>

Loading…
Cancel
Save