Bug 16183: Confirm message upon deleting patron messages
authorAleisha <aleishaamohia@hotmail.com>
Thu, 31 Mar 2016 21:42:06 +0000 (21:42 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Thu, 7 Apr 2016 00:02:09 +0000 (00:02 +0000)
To test:
1) Go to a patron circulation page and add a message
2) Click '[Delete]'
3) Confirm that a confirm dialog shows up and 'Cancel' and 'OK' do what
   is expected.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index e9d3956..4727192 100644 (file)
@@ -47,6 +47,7 @@ var relatives_borrowernumbers = new Array();
 
 var MSG_ADD_MESSAGE = _("Add a new message");
 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
+var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
 
 columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
 
@@ -844,7 +845,7 @@ No patron matched <span class="ex">[% message %]</span>
                         <i>"[% message.message %]"</i>
                     </span>
                     [% IF message.branchcode == branch OR Koha.Preference('AllowAllMessageDeletion') %]
-                        <a href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id %]&amp;borrowernumber=[% message.borrowernumber %]">[Delete]</a>
+                        <a href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id %]&amp;borrowernumber=[% message.borrowernumber %]" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);">[Delete]</a>
                     [% END %]
                 </li>
             [% END %]