From ca2028d0e74950564e53f7335e0b66be111f445b 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 Signed-off-by: Jonathan Druart --- .../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 97ebaecd32..9549d0245e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -119,14 +119,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: @@ -388,9 +388,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'); }); @@ -404,11 +405,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.39.5