From 7ca669e56c3704a2489d6f73d0d83c39a6da90b2 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 20 Jan 2021 12:15:49 +0000 Subject: [PATCH] Bug 22773: (follow-up) Ensure buttons only affect their related table Also cleans up a few rebase issues --- .../intranet-tmpl/prog/en/modules/acqui/invoices.tt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt index 16fbab2db8..ba7ea1b125 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -114,14 +114,15 @@ [% IF CAN_user_acquisition_merge_invoices %] - Merge selected invoices [% IF tab == 'closed' %] - Reopen selected invoices + Merge selected invoices + Reopen selected invoices [% ELSE %] - Close selected invoices + Merge selected invoices + Close selected invoices [% END %] - [% END %] + [% END %]
- [% END %] [% ELSE %]

Sorry, but there are no results for your search.

Search was: @@ -384,9 +384,10 @@ $('#open_sel,#close_sel').click(function () { var referer = $(this).attr("data-referer"); var op = $(this).attr("data-op"); + var table = $(this).data('table'); var invoice_link = "invoice.pl?op="+op; - if ($('.select-invoice:checked').length) { - $('.select-invoice:checked').each(function () { + if ($('#' + table + ' .select-invoice:checked').length) { + $('#' + table + ' .select-invoice:checked').each(function () { var row = $(this).parents('tr'); invoice_link = invoice_link + "&invoiceid="+$(row).attr('data-invoiceid'); }); @@ -400,11 +401,12 @@ var booksellerid; var mismatch; var invoices = [ ]; - if ($('.select-invoice:checked').size() < 2) { + var table = $(this).data('table'); + if ($('#' + table + ' .select-invoice:checked').size() < 2) { alert(_("You must select at least two invoices to merge.")); return false; } - $('.select-invoice:checked').each(function () { + $('#' + table + ' .select-invoice:checked').each(function () { var row = $(this).parents('tr'); booksellerid = booksellerid || $(row).attr('data-booksellerid'); if (booksellerid !== $(row).attr('data-booksellerid')) { -- 2.11.0