Lines 54-60
if ( $query->param('sendEmail') || $query->param('resendEmail') ) {
Link Here
|
54 |
$email ||= ''; # avoid undef |
54 |
$email ||= ''; # avoid undef |
55 |
my $borrower; |
55 |
my $borrower; |
56 |
my $search_results; |
56 |
my $search_results; |
57 |
|
|
|
58 |
# Find the borrower by his userid or email |
57 |
# Find the borrower by his userid or email |
59 |
if( $username ){ |
58 |
if( $username ){ |
60 |
$search_results = [ Koha::Borrowers->search({ userid => $username }) ]; |
59 |
$search_results = [ Koha::Borrowers->search({ userid => $username }) ]; |
Lines 62-69
if ( $query->param('sendEmail') || $query->param('resendEmail') ) {
Link Here
|
62 |
elsif ( $email ){ |
61 |
elsif ( $email ){ |
63 |
$search_results = [ Koha::Borrowers->search({-or => {email => $email, emailpro=> $email, B_email=>$email }}) ]; |
62 |
$search_results = [ Koha::Borrowers->search({-or => {email => $email, emailpro=> $email, B_email=>$email }}) ]; |
64 |
} |
63 |
} |
65 |
|
64 |
if ( not $search_results ){ |
66 |
if(scalar @$search_results > 1){ # Many matching borrowers |
65 |
$hasError = 1; |
|
|
66 |
$errNoBorrowerFound = 1; |
67 |
} |
68 |
elsif(scalar @$search_results > 1){ # Many matching borrowers |
67 |
$hasError = 1; |
69 |
$hasError = 1; |
68 |
$errTooManyEmailFound = 1; |
70 |
$errTooManyEmailFound = 1; |
69 |
} |
71 |
} |
70 |
- |
|
|