From 8af64fe6128d20917ca413613ce387a3ef196632 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 14 Jul 2017 12:19:13 -0300 Subject: [PATCH] Bug 18938: (bug 17829 follow-up) Replace 2 occurrences of GetMember left behind Between patch submission and push, 2 new occurrences appeared in the codebase. Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart (cherry picked from commit 2f1a1fc4b96a91fc054646f91643d8ff46456055) Signed-off-by: Fridolin Somers --- opac/opac-issue-note.pl | 12 ++++++------ opac/svc/patron_notes | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/opac/opac-issue-note.pl b/opac/opac-issue-note.pl index becd7083f7..94773e540b 100755 --- a/opac/opac-issue-note.pl +++ b/opac/opac-issue-note.pl @@ -23,13 +23,13 @@ use CGI qw ( -utf8 ); use C4::Koha; use C4::Context; use C4::Scrubber; -use C4::Members; use C4::Output; use C4::Auth; use C4::Biblio; use C4::Letters; use Koha::Checkouts; use Koha::DateUtils; +use Koha::Patrons; my $query = new CGI; @@ -43,10 +43,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -my $member = C4::Members::GetMember( borrowernumber => $borrowernumber ); +my $patron = Koha::Patrons->find( $borrowernumber ); $template->param( - firstname => $member->{'firstname'}, - surname => $member->{'surname'}, + firstname => $patron->firstname, + surname => $patron->surname, borrowernumber => $borrowernumber, ); @@ -76,10 +76,10 @@ if ( $action eq 'issuenote' && C4::Context->preference('AllowCheckoutNotes') ) { branchcode => $branch, tables => { 'biblio' => $biblio->{biblionumber}, - 'borrowers' => $member->{borrowernumber}, + 'borrowers' => $borrowernumber, }, ); - C4::Message->enqueue($letter, $member, 'email'); + C4::Message->enqueue($letter, $patron->unblessed, 'email'); } } print $query->redirect("/cgi-bin/koha/opac-user.pl"); diff --git a/opac/svc/patron_notes b/opac/svc/patron_notes index d241f0c970..621ce448df 100755 --- a/opac/svc/patron_notes +++ b/opac/svc/patron_notes @@ -27,10 +27,10 @@ use CGI; use C4::Output qw(:DEFAULT :ajax); use C4::Scrubber; use C4::Circulation; -use C4::Members; use C4::Biblio; use Koha::Checkouts; use Koha::DateUtils; +use Koha::Patrons; =head1 NAME @@ -57,7 +57,7 @@ if ($is_ajax) { my $issue_id = $query->param('issue_id'); my $clean_note = $scrubber->scrub($note); my $status = "saved"; - my ($member, $issue); + my ($patron, $issue); my ( $template, $borrowernumber, $cookie ) = C4::Auth::get_template_and_user({ template_name => "opac-user.tt", @@ -68,7 +68,7 @@ if ($is_ajax) { # verify issue_id if ( $issue_id =~ /\d+/ ) { - $member = GetMember(borrowernumber => $borrowernumber); + $patron = Koha::Patrons->find( $borrowernumber ); $issue = Koha::Checkouts->find($issue_id); if ( $issue->borrowernumber != $borrowernumber ) { $status = "fail"; @@ -86,10 +86,10 @@ if ($is_ajax) { branchcode => $branch, tables => { 'biblio' => $biblio->{biblionumber}, - 'borrowers' => $member->{borrowernumber}, + 'borrowers' => $borrowernumber, }, ); - C4::Message->enqueue($letter, $member, 'email'); + C4::Message->enqueue($letter, $patron->unblessed, 'email'); } else { # note empty, i.e removed $status = "removed"; } -- 2.39.5