From dc8044cc15fae7b13b183da8ed09bda69e19d2e9 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 21 May 2018 14:56:58 -0400 Subject: [PATCH] Bug 20798: Client side validation for for fund selection prevents adding only some records to a basket Bug 19453 "fixed" the fund validation that never actually worked. This validation should be removed altogether instead. It is overly simplistic and simply checks to see if each record in the batch has a fund selected regardless of whether that record will be imported or not. In addition, the code completely ignores items generated by MarcItemFieldsToOrder such that even if items on that page have a fund selected, the javascript forces the librarian to make a selection from the left-hand fund pulldown even though it will not be used. Considering this bad validation is basically 'new' as it never worked before, the most sensible course of action would be to 'undo' the change and remove the validation. Test Plan: 1) Add records to a basket from an import batch 2) Select only some of those items in the batch 3) Note Koha will not let you import them unless you set funds for *all* records in the batch 4) Apply this patch 5) Note Koha no longer forces a budget to be selected in the pulldown Signed-off-by: Katrin Fischer https://bugs.koha-community.org/show_bug.cgi?id=20789 --- .../intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt | 14 -------------- 1 file changed, 14 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 473e076..2d54193 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -553,20 +553,6 @@ } - if (! $("#all_budget_id").val() ) { - // If there is no default fund - var error = 0; - $("select[name='budget_id']").each(function() { - if (!$(this).val()) { - error++; - } - }); - if ( error > 0 ) { - alert(_("Some budgets are not defined in item records")); - return false; - } - } - return disableUnchecked($(this)); }); $('#tabs').tabs(); -- 2.1.4