From 3626e7d0b8ef60cf81f6f9312baa3f1b75f86267 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 25 Apr 2014 11:14:00 +0200 Subject: [PATCH] Bug 10875: Preselect the fund located in the record It is useless to copy the fund list in a new node. It seems easier to hide/show inactive/active funds. This patch also adds a "(inactive)" marker in the fund list for inactive funds. If the fund located in the record is inactive, it is displayed by default and cannot be hidden. --- .../prog/en/modules/acqui/addorderiso2709.tt | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 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 b725e0e..2f500a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -31,26 +31,24 @@ "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(); + $("select[name='all_budget_id'] .b_inactive").hide(); + $("select[name='budget_id'] .b_inactive").hide(); $("#showallbudgets").click(function() { if ($(this).is(":checked")) { - $("select[name='budget_id']").html(disabledBudgetsCopy); //Puts back all the funds + $("select[name='budget_id'] .b_inactive").show(); } else { - $("select[name='budget_id'] .b_inactive").remove(); + $("select[name='budget_id'] .b_inactive").hide(); } }); $("#all_showallbudgets").click(function() { if ($(this).is(":checked")) { - $("select[name='all_budget_id']").html(disabledBudgetsCopy); //Puts back all the funds + $("select[name='all_budget_id'] .b_inactive").show(); } else { - $("select[name='all_budget_id'] .b_inactive").remove(); + $("select[name='all_budget_id'] .b_inactive").hide(); } }); @@ -240,10 +238,14 @@ [% FOREACH budget IN budget_loop %] [% IF ( budget.b_id == biblio.budget_id ) %] + [% IF budget.b_active %] + [% ELSE %] + + [% END %] [% ELSE %] [% IF budget.b_active %] - [% ELSE %] + [% ELSE %] [% END %] [% END %] [% END %] @@ -332,7 +334,7 @@ [% FOREACH budget_loo IN budget_loop %] [% IF ( budget_loo.b_active ) %] - [% ELSE %] + [% ELSE %] [% END %] [% END %] -- 1.7.10.4