View | Details | Raw Unified | Return to bug 14610
Collapse All | Expand All

(-)a/circ/request-article.pl (-3 / +3 lines)
Lines 23-29 use C4::Output; Link Here
23
use C4::Auth;
23
use C4::Auth;
24
use C4::Utils::DataTables::Members;
24
use C4::Utils::DataTables::Members;
25
use Koha::Biblios;
25
use Koha::Biblios;
26
use Koha::Borrowers;
26
use Koha::Patrons;
27
use Koha::ArticleRequests;
27
use Koha::ArticleRequests;
28
28
29
my $cgi = new CGI;
29
my $cgi = new CGI;
Lines 44-50 my $patron_cardnumber = $cgi->param('patron_cardnumber'); Link Here
44
my $patron_id         = $cgi->param('patron_id');
44
my $patron_id         = $cgi->param('patron_id');
45
45
46
my $biblio = Koha::Biblios->find($biblionumber);
46
my $biblio = Koha::Biblios->find($biblionumber);
47
my $patron = Koha::Borrowers->find(
47
my $patron = Koha::Patrons->find(
48
    $patron_id ? $patron_id : { cardnumber => $patron_cardnumber } );
48
    $patron_id ? $patron_id : { cardnumber => $patron_cardnumber } );
49
49
50
if ( $action eq 'create' ) {
50
if ( $action eq 'create' ) {
Lines 89-95 if ( !$patron && $patron_cardnumber ) { Link Here
89
    my $patrons = $results->{patrons};
89
    my $patrons = $results->{patrons};
90
90
91
    if ( scalar @$patrons == 1 ) {
91
    if ( scalar @$patrons == 1 ) {
92
        $patron = Koha::Borrowers->find( $patrons->[0]->{borrowernumber} );
92
        $patron = Koha::Patrons->find( $patrons->[0]->{borrowernumber} );
93
    }
93
    }
94
    elsif (@$patrons) {
94
    elsif (@$patrons) {
95
        $template->param( patrons => $patrons );
95
        $template->param( patrons => $patrons );
(-)a/opac/opac-request-article.pl (-2 / +2 lines)
Lines 25-31 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
26
27
use Koha::Biblios;
27
use Koha::Biblios;
28
use Koha::Borrowers;
28
use Koha::Patrons;
29
29
30
my $cgi = new CGI;
30
my $cgi = new CGI;
31
31
Lines 75-81 if ( $action eq 'create' ) { Link Here
75
}
75
}
76
76
77
my $biblio = Koha::Biblios->find($biblionumber);
77
my $biblio = Koha::Biblios->find($biblionumber);
78
my $patron = Koha::Borrowers->find($borrowernumber);
78
my $patron = Koha::Patrons->find($borrowernumber);
79
79
80
$template->param(
80
$template->param(
81
    biblio => $biblio,
81
    biblio => $biblio,
(-)a/t/db_dependent/ArticleRequests.t (-5 / +4 lines)
Lines 23-29 use Test::More tests => 49; Link Here
23
use Koha::Database;
23
use Koha::Database;
24
24
25
use Koha::Biblio;
25
use Koha::Biblio;
26
use Koha::Borrower;
26
use Koha::Patron;
27
use Koha::Library;
27
use Koha::Library;
28
28
29
BEGIN {
29
BEGIN {
Lines 61-73 ok( $item->id, 'Koha::Item created' ); Link Here
61
61
62
my $branch   = Koha::Libraries->search()->next();
62
my $branch   = Koha::Libraries->search()->next();
63
my $category = $schema->resultset('Category')->next();
63
my $category = $schema->resultset('Category')->next();
64
my $patron   = Koha::Borrower->new(
64
my $patron   = Koha::Patron->new(
65
    {
65
    {
66
        categorycode => $category->id,
66
        categorycode => $category->id,
67
        branchcode   => $branch->id,
67
        branchcode   => $branch->id,
68
    }
68
    }
69
)->store();
69
)->store();
70
ok( $patron->id, 'Koha::Borrower created' );
70
ok( $patron->id, 'Koha::Patron created' );
71
71
72
my $article_request = Koha::ArticleRequest->new(
72
my $article_request = Koha::ArticleRequest->new(
73
    {
73
    {
Lines 91-97 $article_request->store(); Link Here
91
91
92
is( $article_request->biblio->id,   $biblio->id, '$ar->biblio() gets corrosponding Koha::Biblio object' );
92
is( $article_request->biblio->id,   $biblio->id, '$ar->biblio() gets corrosponding Koha::Biblio object' );
93
is( $article_request->item->id,     $item->id,   '$ar->item() gets corrosponding Koha::Item object' );
93
is( $article_request->item->id,     $item->id,   '$ar->item() gets corrosponding Koha::Item object' );
94
is( $article_request->borrower->id, $patron->id, '$ar->borrower() gets corrosponding Koha::Borrower object' );
94
is( $article_request->borrower->id, $patron->id, '$ar->borrower() gets corrosponding Koha::Patron object' );
95
95
96
my $ar = $patron->article_requests();
96
my $ar = $patron->article_requests();
97
is( ref($ar),      'Koha::ArticleRequests', '$patron->article_requests returns Koha::ArticleRequests object' );
97
is( ref($ar),      'Koha::ArticleRequests', '$patron->article_requests returns Koha::ArticleRequests object' );
98
- 

Return to bug 14610