From 2fa33d568d82aae9a0795d642e8ef63c9e9239bf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Sep 2013 10:01:34 +0200 Subject: [PATCH] Bug 10875: Add order from a staged file should not display inactive funds When adding an order from a staged file, a link "show all funds" is now added on the top of the page. All inactive funds are hidden by default. --- acqui/addorderiso2709.pl | 5 +++ .../prog/en/modules/acqui/addorderiso2709.tt | 40 +++++++++++++++++--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index f3c124e..5f174f4 100755 --- a/acqui/addorderiso2709.pl +++ b/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,); my $CGIsort1; 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 4a72396..83cf1b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/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'); @@ -153,6 +176,8 @@
Check all Uncheck all + + @@ -210,12 +235,14 @@ [% Budget_name %] [% ELSE %] @@ -300,14 +327,15 @@
  • + +
  • [% END %] -- 1.7.10.4