From c790129c7dd87b299f70c53a137199e3e45dab66 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 31 Jan 2024 10:51:49 +0100 Subject: [PATCH] Bug 34478: Rename action with op - mod_debarment Signed-off-by: Jonathan Druart --- .../prog/en/includes/patron-restrictions-tab.inc | 12 ++++++++---- members/mod_debarment.pl | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc index 9b95aae636..d1a4a64ccd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc @@ -41,9 +41,13 @@ [% restriction.created | $KohaDates %] [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] - - Remove - +
+ [% INCLUDE 'csrf-token.inc' %] + + + + +
[% END %] @@ -56,7 +60,7 @@
[% INCLUDE 'csrf-token.inc' %] - +
Add manual restriction
    diff --git a/members/mod_debarment.pl b/members/mod_debarment.pl index 5e9febb0d9..5fc84355aa 100755 --- a/members/mod_debarment.pl +++ b/members/mod_debarment.pl @@ -30,7 +30,7 @@ my $cgi = CGI->new; my ( $loggedinuserid, $cookie, $sessionID ) = checkauth( $cgi, 0, { borrowers => 'edit_borrowers' }, 'intranet' ); my $borrowernumber = $cgi->param('borrowernumber'); -my $action = $cgi->param('action'); +my $op = $cgi->param('op'); my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } ); my $patron = Koha::Patrons->find($borrowernumber); @@ -38,11 +38,11 @@ my $patron = Koha::Patrons->find($borrowernumber); # Ideally we should display a warning on the interface if the patron is not allowed # to modify a debarment # But a librarian is not supposed to hack the system -$action = '' unless $logged_in_user->can_see_patron_infos( $patron ); +$op = '' unless $logged_in_user->can_see_patron_infos( $patron ); -if ( $action eq 'cud-del' ) { +if ( $op eq 'cud-del' ) { DelDebarment( scalar $cgi->param('borrower_debarment_id') ); -} elsif ( $action eq 'cud-add' ) { +} elsif ( $op eq 'cud-add' ) { my $expiration = $cgi->param('expiration'); my $type = $cgi->param('debarred_type') // 'MANUAL'; if ($expiration) { -- 2.39.5