From dad820b5c3a8e1d1d2737bae2498b3e202423d82 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 1 Jun 2017 14:03:52 -0300 Subject: [PATCH] Bug 18789: Update other occurences where is->child should be used Trivial changes here, just do a code review on the QA step Signed-off-by: Kyle M Hall --- members/boraccount.pl | 2 +- members/mancredit.pl | 2 +- members/maninvoice.pl | 2 +- members/member-flags.pl | 2 +- members/member-password.pl | 2 +- members/moremember.pl | 2 +- members/printfeercpt.pl | 4 +--- members/printinvoice.pl | 4 +--- members/readingrec.pl | 3 +-- members/routing-lists.pl | 2 -- 10 files changed, 9 insertions(+), 16 deletions(-) diff --git a/members/boraccount.pl b/members/boraccount.pl index fca11b9..de7563d 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -65,7 +65,7 @@ if ( $action eq 'reverse' ) { ReversePayment( scalar $input->param('accountlines_id') ); } -if ( $patron->category->category_type eq 'C') { +if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/mancredit.pl b/members/mancredit.pl index 3536e22..48873d3 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -80,7 +80,7 @@ if ($add){ ); my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); - if ( $patron->category->category_type eq 'C') { + if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/maninvoice.pl b/members/maninvoice.pl index fefa036..d0c0c43 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -108,7 +108,7 @@ if ($add){ } $template->param( invoice_types_loop => \@invoice_types ); - if ( $patron->category->category_type eq 'C') { + if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/member-flags.pl b/members/member-flags.pl index 3c24ead..9842b2f 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -182,7 +182,7 @@ if ($input->param('newflags')) { push @loop, \%row; } - if ( $category_type eq 'C') { + if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/member-password.pl b/members/member-password.pl index 6884a14..2f022a8 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -96,7 +96,7 @@ if ( $newpassword and not @errors) { } } -if ( $category_type eq 'C') { +if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/moremember.pl b/members/moremember.pl index 7785930..3f6a3cd 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -167,7 +167,7 @@ if ( $patron->is_debarred ) { $data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex}; -if ( $category_type eq 'C') { +if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl index 4cdbbd7..fa4be37 100755 --- a/members/printfeercpt.pl +++ b/members/printfeercpt.pl @@ -54,13 +54,11 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); -my $category = $patron->category; - if ( $action eq 'print' ) { # ReversePayment( $borrowernumber, $input->param('accountno') ); } -if ( $category->category_type eq 'C') { +if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycde ) if $patron_categories->count == 1; diff --git a/members/printinvoice.pl b/members/printinvoice.pl index 49582f3..0a05164 100755 --- a/members/printinvoice.pl +++ b/members/printinvoice.pl @@ -53,9 +53,7 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); -my $category = $patron->category; - -if ( $category->category_type eq 'C' ) { +if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/readingrec.pl b/members/readingrec.pl index 7c7f008..727da64 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -93,8 +93,7 @@ if ( $op eq 'export_barcodes' ) { } } -my $category = $patron->category; -if ( $category->category_type eq 'C') { +if ( $patron->is_child ) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; diff --git a/members/routing-lists.pl b/members/routing-lists.pl index a9f819d..f35c701 100755 --- a/members/routing-lists.pl +++ b/members/routing-lists.pl @@ -52,8 +52,6 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); -my $category = $patron->category; - my $count; my @borrowerSubscriptions; ($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber ); -- 2.10.2