@@ -, +, @@ not display inactive funds --- acqui/addorderiso2709.pl | 5 +++ .../prog/en/modules/acqui/addorderiso2709.tt | 40 +++++++++++++++++--- 2 files changed, 39 insertions(+), 6 deletions(-) --- a/acqui/addorderiso2709.pl +++ a/acqui/addorderiso2709.pl @@ -306,9 +306,14 @@ foreach my $r ( @{$budgets_hierarchy} ) { b_txt => $r->{budget_name}, b_sort1_authcat => $r->{'sort1_authcat'}, b_sort2_authcat => $r->{'sort2_authcat'}, + b_active => $r->{budget_period_active}, b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0, }; } + +@{$budget_loop} = + sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop}; + $template->param( budget_loop => $budget_loop,); output_html_with_http_headers $input, $cookie, $template->output; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -31,6 +31,29 @@ "aaSorting": [] } ) ); + //keep a copy of all budgets before removing the inactives + disabledBudgetsCopy = $("select[name='all_budget_id']").html(); + $("select[name='all_budget_id'] .b_inactive").remove(); + $("select[name='budget_id'] .b_inactive").remove(); + + $("#showallbudgets").click(function() { + if ($(this).is(":checked")) { + $("select[name='budget_id']").html(disabledBudgetsCopy); //Puts back all the funds + } + else { + $("select[name='budget_id'] .b_inactive").remove(); + } + }); + + $("#all_showallbudgets").click(function() { + if ($(this).is(":checked")) { + $("select[name='all_budget_id']").html(disabledBudgetsCopy); //Puts back all the funds + } + else { + $("select[name='all_budget_id'] .b_inactive").remove(); + } + }); + $("select[name='budget_id']").change(function(){ var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); @@ -155,6 +178,8 @@
Check all Uncheck all + + @@ -212,12 +237,14 @@ [% Budget_name %] [% ELSE %] @@ -302,14 +329,15 @@
  • + +
  • [% END %] --