Bug 15548 [QA Followup] - More new uses of Koha::Borrower
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
This commit is contained in:
parent
ed882397da
commit
77e1e7c4ef
|
|
@ -103,7 +103,7 @@ sub GetValidLinkInfo {
|
|||
=cut
|
||||
|
||||
sub SendPasswordRecoveryEmail {
|
||||
my $borrower = shift; # Koha::Borrower
|
||||
my $borrower = shift; # Koha::Patron
|
||||
my $userEmail = shift; #to_address (the one specified in the request)
|
||||
my $update = shift;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use Modern::Perl;
|
|||
|
||||
use Carp;
|
||||
|
||||
use Koha::Borrowers;
|
||||
use Koha::Patrons;
|
||||
|
||||
use base qw(Koha::Object);
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ Gives the number of patrons using this provider
|
|||
sub patrons_using {
|
||||
my ( $self ) = @_;
|
||||
|
||||
return Koha::Borrowers->search( { sms_provider_id => $self->id } )->count();
|
||||
return Koha::Patrons->search( { sms_provider_id => $self->id } )->count();
|
||||
}
|
||||
|
||||
=head3 _type
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use C4::Context;
|
|||
use C4::Passwordrecovery
|
||||
qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery);
|
||||
use Koha::AuthUtils qw(hash_password);
|
||||
use Koha::Borrowers;
|
||||
use Koha::Patrons;
|
||||
my $query = new CGI;
|
||||
use HTML::Entities;
|
||||
|
||||
|
|
@ -58,10 +58,10 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) {
|
|||
|
||||
# Find the borrower by his userid or email
|
||||
if ($username) {
|
||||
$search_results = [ Koha::Borrowers->search( { userid => $username } ) ];
|
||||
$search_results = [ Koha::Patrons->search( { userid => $username } ) ];
|
||||
}
|
||||
elsif ($email) {
|
||||
$search_results = [ Koha::Borrowers->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) ];
|
||||
$search_results = [ Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) ];
|
||||
}
|
||||
if ( not $search_results || scalar @$search_results > 1 ) {
|
||||
$hasError = 1;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use Modern::Perl;
|
|||
use C4::Context;
|
||||
use C4::Letters;
|
||||
use Koha::Database;
|
||||
use Koha::Borrowers;
|
||||
use Koha::Patrons;
|
||||
|
||||
use Test::More tests => 16;
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ ok( C4::Passwordrecovery::CompletePasswordRecovery($uuid2) == 0, "[CompletePassw
|
|||
# C4::Passwordrecovery::SendPasswordRecoveryEmail #
|
||||
###################################################
|
||||
|
||||
my $borrower = shift [ Koha::Borrowers->search( { userid => $userid1 } ) ];
|
||||
my $borrower = shift [ Koha::Patrons->search( { userid => $userid1 } ) ];
|
||||
ok( C4::Passwordrecovery::SendPasswordRecoveryEmail($borrower, $email1, 0) == 1, "[SendPasswordRecoveryEmail] Returns 1 on success" );
|
||||
my $letters = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber1, limit => 99 } );
|
||||
ok( scalar @$letters == 1, "[SendPasswordRecoveryEmail] There is a letter in the queue for our borrower");
|
||||
|
|
|
|||
Loading…
Reference in New Issue