From 3df23d91f9ded9aab8213e3979267b709f5a716e Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 18 Oct 2023 01:38:54 +0000 Subject: [PATCH] Bug 8367: (follow-up) Fix for circ rules editor Make sure holds pickup period field is empty when editing a 'default' rule. --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index feed1f5b5ab..00de0896bc4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -1531,6 +1531,7 @@ $(this).attr('selected', 'selected'); } }); + var current_input_id = $(current_column).children('input').first().attr('id'); if ( i == 0 || i == 1 ) { // Disable the 2 first columns, we cannot update them. var val = $(current_column).find("select option:selected").val(); @@ -1541,13 +1542,14 @@ // Remove potential previous input added $(current_column).find("input").remove(); $(current_column).append(""); - } else if ( i == 5 || i == 6 || i == 26 || i == 27 || i == 28 ) { + } else if ( i == 5 || i == 6 || i == 26 || i == 27 || i == 28 || current_input_id === "holds_pickup_period" ) { // If the value is not an integer for // - "Current checkouts allowed" // - "Current on-site checkouts allowed" // - "Holds allowed (total)" // - "Holds allowed (daily)" // - "Holds per record (count)" + // - "Holds pickup period (day)" // The value is "Unlimited" (or an equivalent translated string) // an it should be set to an empty string if( !((parseFloat(itm_text) == parseInt(itm_text)) && !isNaN(itm_text)) ) { -- 2.30.2