From 53fa38f539400060a481783c7ca068f064e8459b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 5 Mar 2024 11:58:37 -0300 Subject: [PATCH] Bug 36193: cud- treatment for restrictions.pl Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- admin/restrictions.pl | 4 ++-- .../prog/en/modules/admin/restrictions.tt | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/admin/restrictions.pl b/admin/restrictions.pl index 5ae01ad6f2..bfeb82c1f1 100755 --- a/admin/restrictions.pl +++ b/admin/restrictions.pl @@ -99,11 +99,11 @@ if ( $op eq 'add_form') { } } $op = 'list'; -} elsif ( $op eq 'make_default' ) { +} elsif ( $op eq 'cud-make_default' ) { my $restriction = Koha::Patron::Restriction::Types->find($code); $restriction->make_default; $op = 'list'; -} elsif ( $op eq 'cud-delete_confirm' ) { +} elsif ( $op eq 'delete_confirm' ) { $template->param( restriction => scalar Koha::Patron::Restriction::Types->find($code) ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt index fd2910d8e1..0ed1afdc3f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt @@ -225,7 +225,12 @@ Delete [% END %] [% IF !restriction.is_system && !restriction.is_default %] - Make default +
+ [% INCLUDE 'csrf-token.inc' %] + + +
+ Make default [% END %] @@ -270,6 +275,13 @@ $("#fee_limit").prop("required",false).nextAll().remove(); } }); + + $(".make_default_button").on("click", function(e){ + e.preventDefault(); + var code = $(this).data('code'); + $('#make_default_'+code).submit(); + }); + [% Asset.js("js/restrictiontypes.js") | $raw %] [% END %] -- 2.39.5