From f5fa79b039319b3046f6766fcfca0335b3f047df Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Jun 2018 18:06:00 -0300 Subject: [PATCH] Bug 20979: Fix confirm deletion popup when deleting a biblio When deleting an empty bib, error messages pops up "1 order(s) are using this record. You need order managing permissions to delete this record." even though user has superlibrarian permissions. Prevents the deletion of the bib record. Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/js/catalog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/catalog.js b/koha-tmpl/intranet-tmpl/prog/js/catalog.js index 2fba833108..d99d4dc8ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/catalog.js +++ b/koha-tmpl/intranet-tmpl/prog/js/catalog.js @@ -20,8 +20,8 @@ function printBiblio() {window.print(); } /* IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */ -function confirm_deletion() { - var order_manage_permission = $(this).data("order-manage"); +function confirm_deletion(link) { + var order_manage_permission = $(link).data("order-manage"); var is_confirmed; if (count > 0){ is_confirmed = alert( MSG_DELETE_ALL_ITEMS.format(count) ); @@ -80,7 +80,7 @@ $(document).ready(function() { return false; }); $("#deletebiblio").click(function(){ - confirm_deletion(); + confirm_deletion(this); return false; }); $("#deleteallitems").click(function(){ -- 2.17.1