From 41704bdb16bae1feac79bd3d681197080838b584 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 23 Feb 2024 13:12:02 +0100 Subject: [PATCH] Bug 34478: Manual fix - serials/subscription-add.pl Signed-off-by: Jonathan Druart --- serials/subscription-add.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index 0d99d43b70..13a57ecb91 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -46,7 +46,7 @@ my $sub_length; # Permission needed if it is a modification : edit_subscription # Permission needed otherwise (nothing or dup) : create_subscription my $permission = - ( $op eq 'cud-modify' || $op eq 'cud-modsubscription' ) ? "edit_subscription" : "create_subscription"; + ( $op eq 'modify' || $op eq 'cud-modsubscription' ) ? "edit_subscription" : "create_subscription"; our ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "serials/subscription-add.tt", @@ -66,7 +66,7 @@ my $mana_url = C4::Context->config('mana_config'); $template->param( 'mana_url' => $mana_url ); my $subscriptionid = $query->param('subscriptionid'); -if ($op eq 'cud-modify' || $op eq 'dup' || $op eq 'cud-modsubscription') { +if ($op eq 'modify' || $op eq 'dup' || $op eq 'cud-modsubscription') { $subs = GetSubscription($subscriptionid); @@ -74,7 +74,7 @@ if ($op eq 'cud-modify' || $op eq 'dup' || $op eq 'cud-modsubscription') { unless $subs; ## FIXME : Check rights to edit if mod. Could/Should display an error message. - if ($subs->{'cannotedit'} && $op eq 'cud-modify'){ + if ($subs->{'cannotedit'} && $op eq 'modify'){ carp "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); } @@ -84,7 +84,7 @@ if ($op eq 'cud-modify' || $op eq 'dup' || $op eq 'cud-modsubscription') { } my $nextexpected = GetNextExpected($subscriptionid); $nextexpected->{'isfirstissue'} = $nextexpected->{planneddate} eq $firstissuedate ; - $subs->{nextacquidate} = $nextexpected->{planneddate} if($op eq 'cud-modify'); + $subs->{nextacquidate} = $nextexpected->{planneddate} if($op eq 'modify'); unless($op eq 'cud-modsubscription') { foreach my $length_unit (qw(numberlength weeklength monthlength)) { if ($subs->{$length_unit}) { @@ -99,11 +99,11 @@ if ($op eq 'cud-modify' || $op eq 'dup' || $op eq 'cud-modsubscription') { $op => 1, "subtype_$sub_on" => 1, sublength =>$sub_length, - history => ($op eq 'cud-modify'), + history => ($op eq 'modify'), firstacquiyear => substr($firstissuedate,0,4), ); - if($op eq 'cud-modify') { + if($op eq 'modify') { my ($serials_number) = GetSerials($subscriptionid); if($serials_number > 1) { $template->param(more_than_one_serial => 1); @@ -178,7 +178,7 @@ if ($op eq 'cud-addsubscription') { subtype => $sub_on, ); - if ( $op ne 'cud-modsubscription' && $op ne 'dup' && $op ne 'cud-modify' ) { + if ( $op ne 'cud-modsubscription' && $op ne 'dup' && $op ne 'modify' ) { my $letters = get_letter_loop(); $template->param( letterloop => $letters ); } -- 2.39.5