From ee17b3d41759e7dc87c402f194f63f010c589329 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 2 Feb 2024 09:57:52 +0000 Subject: [PATCH] Bug 34478: Changes for patron_lists/list Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/en/modules/patron_lists/list.tt | 2 ++ patron_lists/list.pl | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt index 3ca8e7d39d..8e3b25d3b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt @@ -146,6 +146,7 @@
+ Cancel @@ -216,6 +217,7 @@
+ diff --git a/patron_lists/list.pl b/patron_lists/list.pl index 45b11a1667..3ecf1a8172 100755 --- a/patron_lists/list.pl +++ b/patron_lists/list.pl @@ -31,6 +31,7 @@ use Koha::List::Patron qw( use List::MoreUtils qw( uniq ); my $cgi = CGI->new; +my $op = $cgi->param('op') // q{}; my ( $template, $logged_in_user, $cookie ) = get_template_and_user( { @@ -49,7 +50,7 @@ my @existing = $list->patron_list_patrons; my $patrons_by_id = $cgi->param('patrons_by_id'); my $id_column = $cgi->param('id_column'); -if ( $patrons_by_id ){ +if ( $op eq 'cud-add' && $patrons_by_id ) { push my @patrons_list, uniq( split(/\s\n/, $patrons_by_id) ); my %add_params; $add_params{list} = $list; @@ -71,12 +72,12 @@ if ( $patrons_by_id ){ } my @patrons_to_add = $cgi->multi_param('patrons_to_add'); -if (@patrons_to_add) { +if ( $op eq 'cud-add' && @patrons_to_add) { AddPatronsToList( { list => $list, cardnumbers => \@patrons_to_add } ); } my @patrons_to_remove = $cgi->multi_param('patrons_to_remove'); -if (@patrons_to_remove) { +if ( $op eq 'cud-delete' && @patrons_to_remove) { DelPatronsFromList( { list => $list, patron_list_patrons => \@patrons_to_remove } ); } -- 2.39.5