From 01fb9837d760d76365cca805fb082ae023cd8c26 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 25 Apr 2014 11:14:00 +0200 Subject: [PATCH] Bug 10875: (follow-up) 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. Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- .../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 a6a099a262..b2a2441017 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -26,26 +26,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(); } }); @@ -235,10 +233,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 %] @@ -327,7 +329,7 @@ [% FOREACH budget_loo IN budget_loop %] [% IF ( budget_loo.b_active ) %] - [% ELSE %] + [% ELSE %] [% END %] [% END %] -- 2.39.5