From cbc918f35475e838958f64b9e2c9f7bd5d4b38e6 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Tue, 4 Feb 2020 10:44:39 +0100
Subject: [PATCH] Bug 24569: (bug 23031 follow-up) Fix "add to basket" link

The modal needs to be defined in both cases.
---
 .../prog/en/modules/acqui/booksellers.tt           | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
index 17a2f922b5..ac2161d702 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
@@ -156,22 +156,24 @@
                                                         <li><a href="/cgi-bin/koha/acqui/basket.pl?op=close&basketno=[% basket.basketno | uri %]&booksellerid=[% basket.booksellerid | uri %]"><i class="fa fa-times-circle"></i> Close this basket</a></li>
                                                         [% END %]
                                                     </ul>
-                                                    <!-- Modal -->
-                                                    <div id="addtoBasket[% basket.basketno | html %]" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno | html %]" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
-                                                        <div class="modal-dialog">
-                                                            <div class="modal-content">
-                                                                <div class="modal-body">
-                                                                    [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
-                                                                </div>
-                                                                <div class="modal-footer">
-                                                                    <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
-                                                                </div>
-                                                            </div>
-                                                        </div>
-                                                    </div>
+                                                </div>
+                                            </div>
                                             [% ELSE %]
                                                 <a class="btn btn-default btn-xs" id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a>
                                             [% END %]
+                                            <!-- Modal -->
+                                            <div id="addtoBasket[% basket.basketno | html %]" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno | html %]" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
+                                                <div class="modal-dialog">
+                                                    <div class="modal-content">
+                                                        <div class="modal-body">
+                                                            [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
+                                                        </div>
+                                                        <div class="modal-footer">
+                                                            <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
                                         [% END %]
                                         </td>
                                     </tr>
-- 
2.11.0