@@ -, +, @@ circ rules --- .../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 13 ++++++++++++- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -28,11 +28,22 @@ function clear_edit(){ var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone."); + $(document).ready(function() { $(".delete").on("click",function(){ return confirmDelete(MSG_CONFIRM_DELETE); }); + $("#clone_rules").on("click",function(){ + var library_dropdown = document.getElementById("branch"); + var selected_library = library_dropdown.options[library_dropdown.selectedIndex].value; + if (selected_library === "*") { + var to_library = $("#tobranch option:selected").text(); + var MSG_CONFIRM_CLONE = _("Are you sure you want to clone this standard rule to " + to_library + " library? This will override the existing rules in " + to_library + " library."); + return confirmClone(MSG_CONFIRM_CLONE); + } + }); + $('#cap_fine_to_replacement_price').on('change', function(){ $('#overduefinescap').prop('disabled', $(this).is(':checked') ); }); @@ -156,7 +167,7 @@ $(document).ready(function() { - + [% END %] --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -135,6 +135,10 @@ function confirmDelete(message) { return (confirm(message) ? true : false); } +function confirmClone(message) { + return (confirm(message) ? true : false); +} + function playSound( sound ) { if ( ! ( sound.indexOf('http://') === 0 || sound.indexOf('https://') === 0 ) ) { sound = AUDIO_ALERT_PATH + sound; --