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 <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2024-01-31 15:44:16 +01:00
parent 8df0f91237
commit 7f25a1a131
No known key found for this signature in database
GPG Key ID: A085E712BEF0E0F0
18 changed files with 34 additions and 34 deletions

View File

@ -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});

View File

@ -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],

View File

@ -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'};

View File

@ -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,
}
);

View File

@ -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;

View File

@ -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'};
}

View File

@ -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'
}
);
};

View File

@ -73,7 +73,7 @@ else {
borrowers => $logged_in_user->id
},
},
message_transports => ['cud-email'],
message_transports => ['email'],
}
);
}

View File

@ -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,

View File

@ -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";
}

View File

@ -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');

View File

@ -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;

View File

@ -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],

View File

@ -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,

View File

@ -220,7 +220,7 @@ if ( $op =~ /save/i ) {
{
letter => $letter,
borrowernumber => $patron->borrowernumber,
message_transport_type => 'cud-email'
message_transport_type => 'email'
}
);
}

View File

@ -261,7 +261,7 @@ if ( $op eq 'cud-show' ) {
}
,
{
name => "cud-email",
name => "email",
type => "text",
mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0,
}

View File

@ -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 ) {

View File

@ -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,