From 23bf1c23808daa11c6afada70e854ad1bd6e3da7 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 1 Feb 2024 09:59:26 -0500 Subject: [PATCH] Bug 34478: Manual fix - add op and change link to form - members-toolbar.inc / patron_messages.inc Signed-off-by: Jonathan Druart --- circ/add_message.pl | 5 +++-- circ/del_message.pl | 3 ++- .../prog/en/includes/members-toolbar.inc | 1 + .../prog/en/includes/patron_messages.inc | 18 ++++++++++++++++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/circ/add_message.pl b/circ/add_message.pl index 37fb2d14bc..fb24d5ce78 100755 --- a/circ/add_message.pl +++ b/circ/add_message.pl @@ -35,6 +35,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +my $op = $input->param('op'); my $message_id = $input->param('message_id'); my $borrowernumber = $input->param('borrowernumber'); my $branchcode = $input->param('branchcode'); @@ -42,11 +43,11 @@ my $message_type = $input->param('message_type'); my $borrower_message = $input->param('borrower_message'); my $batch = $input->param('batch'); -if ($message_id) { +if ( $op eq 'cud-edit_message' && $message_id) { my $message = Koha::Patron::Messages->find($message_id); $message->update( { message => $borrower_message } ) if $message; } -else { +elsif( $op eq 'cud-add_message' ) { Koha::Patron::Message->new( { borrowernumber => $borrowernumber, diff --git a/circ/del_message.pl b/circ/del_message.pl index 3e7c775666..64db58bafe 100755 --- a/circ/del_message.pl +++ b/circ/del_message.pl @@ -35,6 +35,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +my $op = $input->param('op'); my $borrowernumber = $input->param('borrowernumber'); my $message_id = $input->param('message_id'); @@ -47,7 +48,7 @@ if ( $message exit; } -$message->delete if $message; +$message->delete if $message && $op eq 'cud-delete'; if ( $input->param('from') eq "moremember" ) { print $input->redirect( diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 792661e5f3..f1965dd6b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -120,6 +120,7 @@