From 60ed1898a09b638ddbf16c5b0054348cd3967832 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 23 Oct 2023 19:56:21 +0000 Subject: [PATCH] Bug 22712: Make 'Show inactive funds' button on addorderiso2907.pl work for item budgets This requires enabling MarcItemFieldsToOrder, see bug 34645 Add an inactive Budget and some funds to your system Import a file with multiple biblios Confirm the button hids/displays the funds for all item orders Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/acqui/addorderiso2709.tt | 16 +++++++++++++--- koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js | 17 +++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index e598629e03..84e22d4f01 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -342,11 +342,21 @@
  • - [% FOREACH budget_loo IN budget_loop %] - [% IF ( budget_loo.b_id ) == ( item.budget_id ) %] - [% ELSE %] + [% IF ( budget_loo.b_active ) %] + [% IF ( budget_loo.b_id ) == ( item.budget_id ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( budget_loo.b_id ) == ( item.budget_id ) %] + + [% ELSE %] + + [% END %] [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js b/koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js index 3c520bac48..75a85e247b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js @@ -6,12 +6,29 @@ $(document).ready(function() { $("select[name='all_budget_id'] .b_inactive").remove(); $("select[name='budget_id'] .b_inactive").remove(); + $(".budget_code_item").each(function(){ + let active_only = $(this).clone(); + active_only.children().remove('.budget_item_inactive'); + active_only.attr('id', this.id + '_active'); + active_only.prop('hidden',false); + active_only.prop('disabled',false); + active_only.removeClass('bci_all').addClass('bci_active'); + $(this).after(active_only); + }); + $(".budget_code_item").change(function(){ + $(this).siblings('select').val( $(this).val() ); + }); + $("#showallbudgets").click(function() { if ($(this).is(":checked")) { $("select[name='budget_id']").html(disabledBudgetsCopy) + $(".bci_active").prop('disabled',true).prop('hidden',true); + $(".bci_all").prop('disabled',false).prop('hidden',false); } else { $("select[name='budget_id'] .b_inactive").remove(); + $(".bci_active").prop('disabled',false).prop('hidden',false); + $(".bci_all").prop('disabled',true).prop('hidden',true); } }); -- 2.39.5