From 7a417aef392c414bdb9c292e13de85f3c4ed5c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Mon, 17 Feb 2020 10:32:26 +0000 Subject: [PATCH] Bug 24669: Show "Unlimited" values correctly in smart-rules.pl The rules "Holds allowed (total)", "Holds allowed (daily)", "Holds per record (count)" were not set empty when in rule editing. Also, the text "Unlimited" was not shown for rule "Holds per record (count)" even though it should have been since empty value means unlimited holds per record. To test: 1. Apply patch 2. Edit the rules "Holds allowed (total)", "Holds allowed (daily)", "Holds per record (count)" to be empty and save 3. Make sure all of the above rules now say Unlimited 4. Edit the rules again and make sure the above rules are now in the rule editing empty. Sponsored-by: The National Library of Finland Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../prog/en/modules/admin/smart-rules.tt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 ed737af2cd..e40138b31b 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 @@ -262,7 +262,13 @@ Unlimited [% END %] - [% holds_per_record | html %] + + [% IF holds_per_record.defined && holds_per_record != '' %] + [% holds_per_record | html %] + [% ELSE %] + Unlimited + [% END %] + [% IF onshelfholds == 1 %] Yes @@ -1016,11 +1022,13 @@ // Remove potential previous input added $(current_column).find("input").remove(); $(current_column).append(""); - } else if ( i == 4 || i == 5 || i == 25 ) { + } else if ( i == 4 || i == 5 || i == 24 || i == 25 || i == 26 ) { // 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)" // The value is "Unlimited" (or an equivalent translated string) // an it should be set to an empty string if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) { -- 2.20.1