From 7f25a1a131df2e928aef9b6058d79870fb0c214f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 31 Jan 2024 15:44:16 +0100 Subject: [PATCH] Bug 34478: op =~ ^cud- in pl/pm - Manual cud-email => email Wrong replace of 'email' in a lot of places. Signed-off-by: Jonathan Druart --- admin/share_content.pl | 2 +- basket/sendbasket.pl | 4 ++-- circ/branchoverdues.pl | 2 +- circ/pendingreserves.pl | 2 +- members/boraccount.pl | 4 ++-- members/memberentry.pl | 6 +++--- members/notices.pl | 2 +- members/two_factor_auth.pl | 2 +- opac/opac-issue-note.pl | 2 +- opac/opac-memberentry.pl | 16 ++++++++-------- opac/opac-password-recovery.pl | 2 +- opac/opac-registration-verify.pl | 2 +- opac/opac-sendbasket.pl | 4 ++-- opac/opac-sendshelf.pl | 6 +++--- suggestion/suggestion.pl | 2 +- tools/modborrowers.pl | 2 +- tools/scheduler.pl | 2 +- virtualshelves/sendshelf.pl | 6 +++--- 18 files changed, 34 insertions(+), 34 deletions(-) diff --git a/admin/share_content.pl b/admin/share_content.pl index 2035db9dff..e1f927ae38 100755 --- a/admin/share_content.pl +++ b/admin/share_content.pl @@ -65,7 +65,7 @@ if ( $op eq 'cud-reset' ) { if ( $op eq 'cud-send' && not $bad_url ) { my $name = $query->param('name'); - my $email = $query->param('cud-email'); + my $email = $query->param('email'); my $content = to_json({name => $name, email => $email}); diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index d172cb3418..352e90c7ae 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -82,7 +82,7 @@ if ($email_add) { tables => { borrowers => $borrowernumber, }, - message_transport_type => 'cud-email', + message_transport_type => 'email', loops => \%loops, substitute => \%substitute, ); @@ -96,7 +96,7 @@ if ($email_add) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'cud-email', + message_transport_type => 'email', to_address => $email_add, reply_address => $user_email, attachments => [$attachment], diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl index c96e6e75a2..bce79d8cf8 100755 --- a/circ/branchoverdues.pl +++ b/circ/branchoverdues.pl @@ -83,7 +83,7 @@ foreach my $num (@getoverdues) { $overdueforbranch{'borrowersurname'} = $num->{'surname'}; $overdueforbranch{'borrowerfirstname'} = $num->{'firstname'}; $overdueforbranch{'borrowerphone'} = $num->{'phone'}; - $overdueforbranch{'borroweremail'} = $num->{'cud-email'}; + $overdueforbranch{'borroweremail'} = $num->{'email'}; $overdueforbranch{'homebranch'} = $num->{'homebranch'}; $overdueforbranch{'itemcallnumber'} = $num->{'itemcallnumber'}; $overdueforbranch{'borrowernumber'} = $num->{'borrowernumber'}; diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 4a6ab964d9..58b956038a 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -89,7 +89,7 @@ if ( $op eq 'cud-cancel_reserve' and $reserve_id ) { C4::Letters::EnqueueLetter( { letter => $letter, borrowernumber => $patron->borrowernumber, - message_transport_type => 'cud-email', + message_transport_type => 'email', from_address => $from_address, } ); diff --git a/members/boraccount.pl b/members/boraccount.pl index 35a61b4220..f629ef5605 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -187,7 +187,7 @@ if ( $op eq 'cud-send_receipt' ) { my $letter = C4::Letters::GetPreparedLetter( module => 'circulation', letter_code => uc( "ACCOUNT_" . $credit->credit_type_code ), - message_transport_type => 'cud-email', + message_transport_type => 'email', lang => $patron->lang, tables => { borrowers => $patron->borrowernumber, @@ -204,7 +204,7 @@ if ( $op eq 'cud-send_receipt' ) { { letter => $letter, borrowernumber => $patron->borrowernumber, - message_transport_type => 'cud-email', + message_transport_type => 'email', } ); C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; diff --git a/members/memberentry.pl b/members/memberentry.pl index a076218447..bddcdb5746 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -365,7 +365,7 @@ if ($op eq 'cud-save' || $op eq 'cud-insert'){ } # Validate emails - my $emailprimary = $input->param('cud-email'); + my $emailprimary = $input->param('email'); my $emailsecondary = $input->param('emailpro'); my $emailalt = $input->param('B_email'); @@ -468,7 +468,7 @@ if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'cud-email' + message_transport_type => 'email' } ); SendQueuedMessages( { message_id => $message_id } ) if $message_id; @@ -507,7 +507,7 @@ if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ $patron = Koha::Patrons->find( $borrowernumber ); if ($NoUpdateEmail) { - delete $newdata{'cud-email'}; + delete $newdata{'email'}; delete $newdata{'emailpro'}; delete $newdata{'B_email'}; } diff --git a/members/notices.pl b/members/notices.pl index 8cef24c453..2e455f7c19 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -84,7 +84,7 @@ if ( $op eq 'send_welcome' ) { letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'cud-email' + message_transport_type => 'email' } ); }; diff --git a/members/two_factor_auth.pl b/members/two_factor_auth.pl index 70449c5ac1..545bccae7e 100755 --- a/members/two_factor_auth.pl +++ b/members/two_factor_auth.pl @@ -73,7 +73,7 @@ else { borrowers => $logged_in_user->id }, }, - message_transports => ['cud-email'], + message_transports => ['email'], } ); } diff --git a/opac/opac-issue-note.pl b/opac/opac-issue-note.pl index 797adec9b6..c3e6c40799 100755 --- a/opac/opac-issue-note.pl +++ b/opac/opac-issue-note.pl @@ -91,7 +91,7 @@ if ( $op eq 'cud-issuenote' && C4::Context->preference('AllowCheckoutNotes') && C4::Letters::EnqueueLetter({ letter => $letter, - message_transport_type => 'cud-email', + message_transport_type => 'email', borrowernumber => $patron->borrowernumber, to_address => $to_address, reply_address => $reply_address, diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 6446024fcd..8fabe5ded6 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -189,7 +189,7 @@ if ( $action eq 'create' ) { authnotrequired => 1, } ); - $template->param( 'cud-email' => $borrower{'cud-email'} ); + $template->param( 'email' => $borrower{'email'} ); my $verification_token = md5_hex( time().{}.rand().{}.$$ ); while ( Koha::Patron::Modifications->search( { verification_token => $verification_token } )->count() ) { @@ -215,8 +215,8 @@ if ( $action eq 'create' ) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'cud-email', - to_address => $borrower{'cud-email'}, + message_transport_type => 'email', + to_address => $borrower{'email'}, from_address => C4::Context->preference('KohaAdminEmailAddress'), } @@ -288,7 +288,7 @@ if ( $action eq 'create' ) { letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'cud-email' + message_transport_type => 'email' } ); SendQueuedMessages( { message_id => $message_id } ) if $message_id; @@ -448,7 +448,7 @@ sub GetMandatoryFields { } if ( $action eq 'create' || $action eq 'new' ) { - $mandatory_fields{'cud-email'} = 1 + $mandatory_fields{'email'} = 1 if C4::Context->preference( 'PatronSelfRegistrationVerifyByEmail'); } @@ -489,9 +489,9 @@ sub CheckMandatoryAttributes{ sub CheckForInvalidFields { my $borrower = shift; my @invalidFields; - if ($borrower->{'cud-email'}) { + if ($borrower->{'email'}) { unless ( Koha::Email->is_valid($borrower->{email}) ) { - push(@invalidFields, "cud-email"); + push(@invalidFields, "email"); } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? { @@ -508,7 +508,7 @@ sub CheckForInvalidFields { push @invalidFields, "duplicate_email"; } } elsif ( C4::Context->preference("PatronSelfRegistrationConfirmEmail") - && $borrower->{'cud-email'} ne $borrower->{'repeat_email'} + && $borrower->{'email'} ne $borrower->{'repeat_email'} && !defined $borrower->{borrowernumber} ) { push @invalidFields, "email_match"; } diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index 934aa77458..0c0824c674 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -28,7 +28,7 @@ my ( $template, $dummy, $cookie ) = get_template_and_user( } ); -my $email = $query->param('cud-email') // q{}; +my $email = $query->param('email') // q{}; my $password = $query->param('newPassword'); my $repeatPassword = $query->param('repeatPassword'); my $id = $query->param('id'); diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl index 6991ab8be8..129d51cbb9 100755 --- a/opac/opac-registration-verify.pl +++ b/opac/opac-registration-verify.pl @@ -141,7 +141,7 @@ elsif ( $rego_found letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'cud-email' + message_transport_type => 'email' } ); SendQueuedMessages( { message_id => $message_id } ) if $message_id; diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 3d144fc513..65dc94b9e6 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -82,7 +82,7 @@ if ( $op eq "cud-send" && $email_add ) { tables => { borrowers => $borrowernumber, }, - message_transport_type => 'cud-email', + message_transport_type => 'email', loops => \%loops, substitute => \%substitute, ); @@ -96,7 +96,7 @@ if ( $op eq "cud-send" && $email_add ) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'cud-email', + message_transport_type => 'email', to_address => $email_add, reply_address => $user_email, attachments => [$attachment], diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index 33e01d48d2..e08b474cb1 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -53,7 +53,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $shelfid = $query->param('shelfid'); -my $email = $query->param('cud-email'); +my $email = $query->param('email'); my $shelf = Koha::Virtualshelves->find($shelfid); if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { @@ -96,7 +96,7 @@ if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { tables => { borrowers => $borrowernumber, }, - message_transport_type => 'cud-email', + message_transport_type => 'email', loops => \%loops, substitute => \%substitute, ); @@ -110,7 +110,7 @@ if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'cud-email', + message_transport_type => 'email', borrowernumber => $patron->borrowernumber, to_address => $email, reply_address => $user_email, diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 987e103a4d..13d2971594 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -220,7 +220,7 @@ if ( $op =~ /save/i ) { { letter => $letter, borrowernumber => $patron->borrowernumber, - message_transport_type => 'cud-email' + message_transport_type => 'email' } ); } diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 1afaa3e21a..ab8b2fff64 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -261,7 +261,7 @@ if ( $op eq 'cud-show' ) { } , { - name => "cud-email", + name => "email", type => "text", mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0, } diff --git a/tools/scheduler.pl b/tools/scheduler.pl index d9568d90ea..4271804483 100755 --- a/tools/scheduler.pl +++ b/tools/scheduler.pl @@ -78,7 +78,7 @@ if ( $mode eq 'job_add' ) { $format = undef; } } - my $email = $input->param('cud-email'); + my $email = $input->param('email'); if ($email) { my $is_valid = Koha::Email->is_valid($email); if ( !$is_valid ) { diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 87a43e9118..e50f3c3cd3 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -50,7 +50,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $shelfid = $query->param('shelfid'); -my $to_address = $query->param('cud-email'); +my $to_address = $query->param('email'); my $shelf = Koha::Virtualshelves->find($shelfid); @@ -95,7 +95,7 @@ if ($to_address) { tables => { borrowers => $borrowernumber, }, - message_transport_type => 'cud-email', + message_transport_type => 'email', loops => \%loops, substitute => \%substitute, ); @@ -109,7 +109,7 @@ if ($to_address) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'cud-email', + message_transport_type => 'email', borrowernumber => $patron->borrowernumber, to_address => $to_address, reply_address => $user_email, -- 2.39.5