From da776e07b879313675ec3270a2c4f4a3fe8b7a11 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Thu, 16 Jan 2020 14:52:00 +0000
Subject: [PATCH] Bug 24433: OPAC account page no longer asks for confirmation
 before deleting hold

This patch restores markup added by Bug 21870 and subsequently removed
accidentally by Bug 21772. This allows the OPAC user summary page to
display a confirmation dialog before deleting a hold.

To test, apply the patch and  log in to the OPAC as a user with holds.

 - On the "Your summary" page, click the "Holds" tab.
 - Click the "Cancel" button next to any hold.
 - You should see a modal dialog asking for confirmation, showing the
   correct title.
 - Test both the "Yes" and "No" actions.
---
 koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
index 3c5ea159386..aea867a2136 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
@@ -184,10 +184,11 @@
                         [% IF ! onlyinfo %]
                             <td class="modify">
                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
-                                    <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
+                                    <form id="delete_hold_[% HOLD.reserve_id | html %]" action="/cgi-bin/koha/opac-modrequest.pl" method="post">
                                     <input type="hidden" name="biblionumber" value="[% HOLD.biblionumber | html %]" />
                                     <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
-                                    <button type="submit" name="submit" class="btn btn-mini btn-danger" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="fa fa-remove"></i> Cancel</button></form>
+                                    <button data-title="[% INCLUDE 'biblio-title-head.inc' biblio=HOLD.biblio %]" data-reserve_id="[% HOLD.reserve_id | html %]" type="submit" class="btn btn-sm btn-danger btn-delete-hold"><i class="fa fa-remove"></i> Cancel</button>
+                                </form>
                                 [% END %]
                             </td>
                         [% END # / IF onlyinfo %]
-- 
2.11.0