X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=koha-tmpl%2Fintranet-tmpl%2Fprog%2Fen%2Fmodules%2Fadmin%2Fsmart-rules.tt;h=e7cc15848a5e70ecbca2fb2630646b8bec35e3b3;hb=c42de7460b9bae9458e2345f6ba8f017d8a12b0c;hp=2f7ec7e488042ab2877f3dd3467d1bc7aa57ffb3;hpb=1802aa91530a4e8716da4a6b956ca6e0cee7d471;p=koha.git 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 2f7ec7e488..e7cc15848a 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 @@ -16,6 +16,9 @@ function clear_edit(){ $(this).val(""); $(this).removeAttr("disabled"); } + if ( type == "checkbox" ) { + $(this).attr('checked', false); + } }); $(edit_row).find("select").removeAttr("disabled"); $(edit_row).find("select option:first").attr("selected", "selected"); @@ -23,6 +26,9 @@ function clear_edit(){ } $(document).ready(function() { + $('#cap_fine_to_replacement_price').on('change', function(){ + $('#overduefinescap').prop('disabled', $(this).is(':checked') ); + }); $('#selectlibrary').find("input:submit").hide(); $('#branch').change(function() { $('#selectlibrary').submit(); @@ -38,7 +44,23 @@ $(document).ready(function() { itm = $(this).text(); itm = itm.replace(/^\s*|\s*$/g,''); var current_column = $("#edit_row td:eq("+i+")"); - if ( i != 5 ) { + if ( i == 6 ) { + // specific processing for the Hard due date column + var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); + var input_value = ''; + if (typeof select_value === 'undefined'){ + select_value = '-1'; + }else { + input_value = itm.split(' ')[1]; + } + $(current_column).find("input[type='text']").val(input_value); + $(current_column).find("select").val(select_value); + } else if ( i == 12 ) { + // specific processing for cap_fine_to_replacement_price + var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); + $('#cap_fine_to_replacement_price').attr('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); // select the corresponding option $(current_column).find("select option").each(function(){ @@ -58,25 +80,14 @@ $(document).ready(function() { // Remove potential previous input added $(current_column).find("input").remove(); $(current_column).append(""); - } else if ( i == 2 ) { - // If the value is not an integer for "Current checkouts allowed" + } else if ( i == 2 || i == 3 ) { + // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed" // 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)) ) { $(current_column).find("input[type='text']").val(""); } } - } else { - // specific processing for the Hard due date column - var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); - var input_value = ''; - if (typeof select_value === 'undefined'){ - select_value = '-1'; - }else { - input_value = itm.split(' ')[1]; - } - $(current_column).find("input[type='text']").val(input_value); - $(current_column).find("select").val(select_value); } }); $("#default-circulation-rules tr:last td:eq(0) select").attr('disabled', 'disabled'); @@ -142,13 +153,16 @@ for="tobranch">Clone these rules to: Clone these rules to: Clone these rules to: Clone these rules to: + + [% IF rule.cap_fine_to_replacement_price %] + + [% ELSE %] + + [% END %] + [% rule.finedays %] [% rule.maxsuspensiondays %] [% rule.renewalsallowed %] @@ -221,7 +249,7 @@ for="tobranch">Clone these rules to: Edit @@ -242,11 +270,12 @@ for="tobranch">Clone these rules to: [% FOREACH itemtypeloo IN itemtypeloop %] - + [% END %] + + + + + @@ -289,7 +325,7 @@ for="tobranch">Clone these rules to: - + @@ -299,6 +335,34 @@ for="tobranch">Clone these rules to: + + + Patron category + Item type + Current checkouts allowed + Current on-site checkouts allowed + Loan period + Unit + Hard due date + Fine amount + Fine charging interval + Charge when? + Fine grace period + Overdue fines cap (amount) + Cap fine at replacement price + Suspension in days (day) + Max. suspension duration (day) + Renewals allowed (count) + Renewal period + No renewal before + Automatic renewal + Holds allowed (count) + On shelf holds allowed + Item level holds + Rental discount (%) +   + + @@ -313,6 +377,7 @@ for="tobranch">Clone these rules to: Clone these rules to: + Clone these rules to: Delete @@ -429,6 +503,7 @@ for="tobranch">Clone these rules to: + @@ -450,11 +525,8 @@ for="tobranch">Clone these rules to: @@ -476,7 +548,7 @@ for="tobranch">Clone these rules to: Clone these rules to: [% FOREACH itemtypeloo IN itemtypeloop %] - + [% END %]