Bug 34478: Manual fix - memberentry (modify)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2023-12-12 17:03:58 +01:00
parent 1ea77fbd19
commit b92e9a2115
No known key found for this signature in database
GPG Key ID: A085E712BEF0E0F0
1 changed files with 9 additions and 9 deletions

View File

@ -74,7 +74,7 @@ if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) {
}
my $actionType = $input->param('actionType') || '';
my $modify = $input->param('cud-modify');
my $modify = $input->param('modify');
my $delete = $input->param('cud-delete');
my $op = $input->param('op');
my $destination = $input->param('destination');
@ -83,7 +83,7 @@ my $check_member = $input->param('check_member');
my $nodouble = $input->param('nodouble');
my $duplicate = $input->param('duplicate');
my $quickadd = $input->param('quickadd');
$nodouble = 1 if ($op eq 'cud-modify' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're
$nodouble = 1 if ($op eq 'modify' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're
# modifying an existing patron, it ipso facto
# isn't a duplicate. Marking FIXME because this
# script needs to be refactored.
@ -167,7 +167,7 @@ $template->param( "cud-add" => 1 ) if ( $op eq 'cud-add' );
$template->param( "quickadd" => 1 ) if ( $quickadd );
$template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' );
$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
if ( $op eq 'cud-modify' or $op eq 'cud-save' or $op eq 'duplicate' ) {
if ( $op eq 'modify' or $op eq 'cud-save' or $op eq 'duplicate' ) {
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
@ -191,7 +191,7 @@ $template->param( patron_category => $category );
# initialize %newdata
my %newdata; # comes from $input->param()
if ( $op eq 'cud-insert' || $op eq 'cud-modify' || $op eq 'cud-save' || $op eq 'duplicate' ) {
if ( $op eq 'cud-insert' || $op eq 'modify' || $op eq 'cud-save' || $op eq 'duplicate' ) {
my @names = ( $borrower_data && $op ne 'cud-save' ) ? keys %$borrower_data : $input->param();
foreach my $key (@names) {
if (defined $input->param($key)) {
@ -400,7 +400,7 @@ elsif ( $borrowernumber ) {
$extended_patron_attributes = Koha::Patrons->find($borrowernumber)->extended_attributes->unblessed;
}
if ( ($op eq 'cud-modify' || $op eq 'cud-insert' || $op eq 'cud-save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){
if ( ($op eq 'modify' || $op eq 'cud-insert' || $op eq 'cud-save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){
unless ($newdata{'dateexpiry'}){
$newdata{'dateexpiry'} = $category->get_expiry_date( $newdata{dateenrolled} ) if $category;
}
@ -527,7 +527,7 @@ if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){
warn "Patron modification failed! - $@"; # Maybe we must die instead of just warn
push @messages, {error => 'error_on_update_patron'};
}
$op = "cud-modify";
$op = "modify";
};
if ( $success ) {
@ -598,7 +598,7 @@ if ($delete){
if ($nok or !$nodouble){
$op="cud-add" if ($op eq "cud-insert");
$op="cud-modify" if ($op eq "cud-save");
$op="modify" if ($op eq "cud-save");
%data=%newdata;
$template->param( updtype => ($op eq 'cud-add' ?'I':'M')); # used to check for $op eq "cud-insert"... but we just changed $op!
unless ($step){
@ -627,7 +627,7 @@ if ($op eq 'cud-add'){
}
$template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1);
}
if ($op eq "cud-modify") {
if ($op eq "modify") {
$template->param( updtype => 'M',modify => 1 );
$template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1) unless $step;
if ( $step == 4 ) {
@ -708,7 +708,7 @@ if (C4::Context->userenv && C4::Context->userenv->{'branch'}) {
$userbranch = C4::Context->userenv->{'branch'};
}
if (defined ($data{'branchcode'}) and ( $op eq 'cud-modify' || $op eq 'duplicate' || ( $op eq 'cud-add' && $category->category_type eq 'C' ) )) {
if (defined ($data{'branchcode'}) and ( $op eq 'modify' || $op eq 'duplicate' || ( $op eq 'cud-add' && $category->category_type eq 'C' ) )) {
$userbranch = $data{'branchcode'};
}
$template->param( userbranch => $userbranch );