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 3ffde1caa3..bfb073ae3c 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 @@ -209,7 +209,7 @@ [% ELSE %] 0 [% END %] - + [% IF c == undef %] All [% ELSE %] @@ -221,7 +221,7 @@ [% ELSE %] 0 [% END %] - + [% IF i == undef %] All [% ELSE %] @@ -252,7 +252,7 @@ [% END %] [% issuelength | html %] - + [% SWITCH daysmode %] [% CASE 'Calendar' %]Skip closed days [% CASE 'Datedue' %]Next open day @@ -261,7 +261,7 @@ [% CASE %]Default [% END %] - + [% IF ( lengthunit == 'days' ) %] Days [% ELSIF ( lengthunit == 'hours') %] @@ -270,7 +270,7 @@ Undefined [% END %] - + [% IF ( hardduedate ) %] [% IF ( hardduedatecompare == '-1' ) %] before [% hardduedate | $KohaDates %] @@ -314,7 +314,7 @@ [% END %] [% renewalperiod | html %] [% norenewalbefore | html %] - + [% IF auto_renew %] Yes [% ELSE %] @@ -344,7 +344,7 @@ Unlimited [% END %] - + [% IF onshelfholds == 1 %] Yes [% ELSIF onshelfholds == 2 %] @@ -353,7 +353,7 @@ If any unavailable [% END %] - + [% IF opacitemholds == 'F'%] Force [% ELSIF opacitemholds == 'Y'%] @@ -363,7 +363,7 @@ [% END %] [% IF Koha.Preference('ArticleRequests') %] - + [% IF article_requests == 'no' %] No [% ELSIF article_requests == 'yes' %] @@ -379,7 +379,7 @@ [% IF Koha.Preference('UseRecalls') %] [% recalls_allowed | html %] [% recalls_per_record | html %] - + [% IF on_shelf_recalls == 'all' %] If all unavailable [% ELSE %] @@ -1462,8 +1462,9 @@ $('#default-circulation-rules td').removeClass('highlighted-row'); $(this).parent().parent().find("td").each(function (i) { $(this).addClass('highlighted-row'); - itm = $(this).text(); - itm = itm.replace(/^\s*|\s*$/g,''); + itm_code = $(this).data('code'); + itm_text = $(this).text(); + itm_text = itm_text.replace(/^\s*|\s*$/g,''); var current_column = $("#edit_row td:eq("+i+")"); if ( i == 3 ) { // specific processing for the Note column @@ -1476,7 +1477,7 @@ if (typeof select_value === 'undefined'){ select_value = '-1'; }else { - input_value = itm.split(' ')[1]; + input_value = itm_text.split(' ')[1]; } $(current_column).find("input[type='text']").val(input_value); $(current_column).find("select").val(select_value); @@ -1486,18 +1487,15 @@ $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') ); $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') ); } else { - $(current_column).find("input[type='text']").val(itm); + $(current_column).find("input[type='text']").val(itm_text); // unformat prices $(current_column).find("input[inputmode='decimal']").each(function() { - $(this).val(itm.unformat_price()); + $(this).val(itm_text.unformat_price()); }); // select the corresponding option $(current_column).find("select option").each(function(){ - opt = $(this).text().toLowerCase(); - opt = opt.replace(/ \(\w*?\)$/,""); //If option is a parent, compare without (All) or the equivalent in other languages - itm = itm.replace(/.*->(.*)/,"$1"); //If item type is part of a group we need to clear the parent description - opt = opt.replace(/^\s*|\s*$/g,''); - if ( opt == itm.toLowerCase() ) { + opt = $(this).attr('value'); + if ( opt == itm_code ) { $(this).attr('selected', 'selected'); } }); @@ -1520,7 +1518,7 @@ // - "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)) ) { + if( !((parseFloat(itm_text) == parseInt(itm_text)) && !isNaN(itm_text)) ) { $(current_column).find("input[type='text']").val(""); } }