From 37d7115dce1a6e801857ad3f6eccc53b644e2e77 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 16 May 2016 11:32:43 +0000 Subject: [PATCH] Bug 14610 [QA Followup] - Switch from Koha::Borrower to Koha::Patron --- circ/request-article.pl | 6 +++--- opac/opac-request-article.pl | 4 ++-- t/db_dependent/ArticleRequests.t | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/circ/request-article.pl b/circ/request-article.pl index 6c083d5..0c76e6c 100755 --- a/circ/request-article.pl +++ b/circ/request-article.pl @@ -23,7 +23,7 @@ use C4::Output; use C4::Auth; use C4::Utils::DataTables::Members; use Koha::Biblios; -use Koha::Borrowers; +use Koha::Patrons; use Koha::ArticleRequests; my $cgi = new CGI; @@ -44,7 +44,7 @@ my $patron_cardnumber = $cgi->param('patron_cardnumber'); my $patron_id = $cgi->param('patron_id'); my $biblio = Koha::Biblios->find($biblionumber); -my $patron = Koha::Borrowers->find( +my $patron = Koha::Patrons->find( $patron_id ? $patron_id : { cardnumber => $patron_cardnumber } ); if ( $action eq 'create' ) { @@ -89,7 +89,7 @@ if ( !$patron && $patron_cardnumber ) { my $patrons = $results->{patrons}; if ( scalar @$patrons == 1 ) { - $patron = Koha::Borrowers->find( $patrons->[0]->{borrowernumber} ); + $patron = Koha::Patrons->find( $patrons->[0]->{borrowernumber} ); } elsif (@$patrons) { $template->param( patrons => $patrons ); diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl index 5920366..b82b77a 100755 --- a/opac/opac-request-article.pl +++ b/opac/opac-request-article.pl @@ -25,7 +25,7 @@ use C4::Auth; use C4::Output; use Koha::Biblios; -use Koha::Borrowers; +use Koha::Patrons; my $cgi = new CGI; @@ -75,7 +75,7 @@ if ( $action eq 'create' ) { } my $biblio = Koha::Biblios->find($biblionumber); -my $patron = Koha::Borrowers->find($borrowernumber); +my $patron = Koha::Patrons->find($borrowernumber); $template->param( biblio => $biblio, diff --git a/t/db_dependent/ArticleRequests.t b/t/db_dependent/ArticleRequests.t index 55cb2bc..af9e1c8 100755 --- a/t/db_dependent/ArticleRequests.t +++ b/t/db_dependent/ArticleRequests.t @@ -23,7 +23,7 @@ use Test::More tests => 49; use Koha::Database; use Koha::Biblio; -use Koha::Borrower; +use Koha::Patron; use Koha::Library; BEGIN { @@ -61,13 +61,13 @@ ok( $item->id, 'Koha::Item created' ); my $branch = Koha::Libraries->search()->next(); my $category = $schema->resultset('Category')->next(); -my $patron = Koha::Borrower->new( +my $patron = Koha::Patron->new( { categorycode => $category->id, branchcode => $branch->id, } )->store(); -ok( $patron->id, 'Koha::Borrower created' ); +ok( $patron->id, 'Koha::Patron created' ); my $article_request = Koha::ArticleRequest->new( { @@ -91,7 +91,7 @@ $article_request->store(); is( $article_request->biblio->id, $biblio->id, '$ar->biblio() gets corrosponding Koha::Biblio object' ); is( $article_request->item->id, $item->id, '$ar->item() gets corrosponding Koha::Item object' ); -is( $article_request->borrower->id, $patron->id, '$ar->borrower() gets corrosponding Koha::Borrower object' ); +is( $article_request->borrower->id, $patron->id, '$ar->borrower() gets corrosponding Koha::Patron object' ); my $ar = $patron->article_requests(); is( ref($ar), 'Koha::ArticleRequests', '$patron->article_requests returns Koha::ArticleRequests object' ); -- 2.1.4