Bugzilla – Attachment 56388 Details for
Bug 16852
Remove C4::Members::GetBorrowerCategorycode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16852: Remove GetBorrowerCategorycode
Bug-16852-Remove-GetBorrowerCategorycode.patch (text/plain), 2.62 KB, created by
Claire Gravely
on 2016-10-13 12:55:10 UTC
(
hide
)
Description:
Bug 16852: Remove GetBorrowerCategorycode
Filename:
MIME Type:
Creator:
Claire Gravely
Created:
2016-10-13 12:55:10 UTC
Size:
2.62 KB
patch
obsolete
>From 5be9e0e06481d775f91341d63ac306ff3e1ba87e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Jul 2016 13:38:45 +0100 >Subject: [PATCH] Bug 16852: Remove GetBorrowerCategorycode > >And use Koha::Patron->categorycode instead > >Test plan: >- Restrict a patron attribute to a patron category >- Use the batch patron modification tool to update a patron of this > category >You should not see the the patron attribute > >Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> >--- > C4/Members.pm | 24 +----------------------- > tools/modborrowers.pl | 4 ++-- > 2 files changed, 3 insertions(+), 25 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 4b2d7ff..2f0f01f 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -79,8 +79,6 @@ BEGIN { > &GetMemberAccountRecords > &GetBorNotifyAcctRecord > >- GetBorrowerCategorycode >- > &GetBorrowersToExpunge > &GetBorrowersWhoHaveNeverBorrowed > &GetBorrowersWithIssuesHistoryOlderThan >@@ -572,7 +570,7 @@ sub ModMember { > } > } > >- my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} ); >+ my $old_categorycode = Koha::Patrons->find( $data{borrowernumber} )->categorycode; > > # get only the columns of a borrower > my $schema = Koha::Database->new()->schema; >@@ -1263,26 +1261,6 @@ sub GetUpcomingMembershipExpires { > return $results; > } > >-=head2 GetBorrowerCategorycode >- >- $categorycode = &GetBorrowerCategoryCode( $borrowernumber ); >- >-Given the borrowernumber, the function returns the corresponding categorycode >- >-=cut >- >-sub GetBorrowerCategorycode { >- my ( $borrowernumber ) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare( qq{ >- SELECT categorycode >- FROM borrowers >- WHERE borrowernumber = ? >- } ); >- $sth->execute( $borrowernumber ); >- return $sth->fetchrow; >-} >- > =head2 GetAge > > $dateofbirth,$date = &GetAge($date); >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index 31e4ec1..8f0a567 100755 >--- a/tools/modborrowers.pl >+++ b/tools/modborrowers.pl >@@ -38,6 +38,7 @@ use Koha::DateUtils qw( dt_from_string ); > use Koha::List::Patron; > use Koha::Libraries; > use Koha::Patron::Categories; >+use Koha::Patrons; > > my $input = new CGI; > my $op = $input->param('op') || 'show_form'; >@@ -294,8 +295,7 @@ if ( $op eq 'do' ) { > } > } > >- # >- my $borrower_categorycode = GetBorrowerCategorycode $borrowernumber; >+ my $borrower_categorycode = Koha::Patrons->find( $borrowernumber )->categorycode; > my $i=0; > for ( @attributes ) { > my $attribute; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16852
:
53097
|
55579
|
56388
|
57057