Bug 21080: Fix patron's attributes display when PA_CLASS is used
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 29 Oct 2018 22:23:53 +0000 (19:23 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 28 Nov 2018 13:15:19 +0000 (14:15 +0100)
When a patron attribute class (AV PA_CLASS) is created, the patron's
edit view is broken:
https://screenshots.firefox.com/62uNhoUtH6rPXm9l/pro.kohadev.org

To recreate:
1. Create 1+ authorised values PA_CLASS
2. Create patron's attributes using it
3. Edit a patron

it depends on the order of the fieldset and the ol elements

This is certainly not the best fix but the display does not look broken!

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 559e051bb9eecbc92f63aa2941caea6ee373fe0e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2b746513b4c2454ccc594510c277c059b56a8797)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

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

index c0b2796..beab664 100644 (file)
@@ -1133,11 +1133,11 @@ $(document).ready(function() {
     <legend id="patron_attributes_lgd">Additional attributes and identifiers</legend>
     <input type="hidden" name="setting_extended_patron_attributes" value="1" />
     [% FOREACH pa_loo IN patron_attributes %]
-        [% IF pa_loo.class %]
-            <fieldset id="aai_[% pa_loo.class %]">
-            <legend id="[% pa_loo.class %]_lgd">[% pa_loo.lib %]</legend>
-        [% END %]
         <ol class="attributes_table">
+            [% IF pa_loo.class %]
+                <fieldset id="aai_[% pa_loo.class | html %]">
+                <legend id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</legend>
+            [% END %]
             [% FOREACH patron_attribute IN pa_loo.items %]
                 <li data-category_code="[% patron_attribute.category_code %]">
                     <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
@@ -1166,8 +1166,8 @@ $(document).ready(function() {
                         [% END %]
                 </li>
             [% END %]
+            [% IF pa_loo.class %]</fieldset>[% END %]
         </ol>
-        [% IF pa_loo.class %]</fieldset>[% END %]
     [% END %]
   </fieldset>
 [% END %][% END %][% END %]