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:
parent
8df0f91237
commit
7f25a1a131
|
|
@ -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});
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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'};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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'};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ else {
|
|||
borrowers => $logged_in_user->id
|
||||
},
|
||||
},
|
||||
message_transports => ['cud-email'],
|
||||
message_transports => ['email'],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ if ( $op =~ /save/i ) {
|
|||
{
|
||||
letter => $letter,
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
message_transport_type => 'cud-email'
|
||||
message_transport_type => 'email'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ if ( $op eq 'cud-show' ) {
|
|||
}
|
||||
,
|
||||
{
|
||||
name => "cud-email",
|
||||
name => "email",
|
||||
type => "text",
|
||||
mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue