Bug 29058: Don't display 'Always show holds' at the bottom of the patron list
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 28 Jan 2022 12:47:35 +0000 (13:47 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 1 Feb 2022 07:55:39 +0000 (21:55 -1000)
The checkbox should not appear if we are selecting a patron

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt

index 9a46b4a..306b8ea 100644 (file)
             [% END %]
 
             [% UNLESS ( patron ) %]
-                [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
-                [% IF hold_count %]
-                    <label for ="always_show_holds">Always show holds</label>
-                    [% IF always_show_holds == 'DONT' %]
-                        <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
-                        [% UNLESS reserveloop %]
-                            <a class="btn btn-default" value="Show holds" id="show_holds_now" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]&show_holds_now=1">Show holds ([% hold_count | html %])</a>
+                [% UNLESS borrowers %]
+                    [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
+                    [% IF hold_count %]
+                        <label for ="always_show_holds">Always show holds</label>
+                        [% IF always_show_holds == 'DONT' %]
+                            <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
+                            [% UNLESS reserveloop %]
+                                <a class="btn btn-default" value="Show holds" id="show_holds_now" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]&show_holds_now=1">Show holds ([% hold_count | html %])</a>
+                            [% END %]
+                        [% ELSE %]
+                            <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
                         [% END %]
-                    [% ELSE %]
-                        <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
                     [% END %]
                 [% END %]
                 [% IF ( reserveloop ) %]