Bug 18789: Update other occurences where is_child should be used
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 1 Jun 2017 17:03:52 +0000 (14:03 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 16 Feb 2018 16:03:58 +0000 (13:03 -0300)
Trivial changes here, just do a code review on the QA step

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
members/boraccount.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/moremember.pl
members/printfeercpt.pl
members/printinvoice.pl
members/readingrec.pl
members/routing-lists.pl

index 8643b90..af35fe8 100755 (executable)
@@ -64,7 +64,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;
index 9dfd2e6..557f517 100755 (executable)
@@ -79,7 +79,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;
index 68a4850..84ed122 100755 (executable)
@@ -107,7 +107,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;
index 63bb249..2398189 100755 (executable)
@@ -181,7 +181,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;
index 0e4db74..115f804 100755 (executable)
@@ -95,7 +95,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;
index b9c70be..2130228 100755 (executable)
@@ -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;
index d6080fb..53e4445 100755 (executable)
@@ -53,13 +53,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;
index 552e0cd..a3ad69b 100755 (executable)
@@ -52,9 +52,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;
index 7a63201..015c56c 100755 (executable)
@@ -92,8 +92,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;
index ca150ab..793317d 100755 (executable)
@@ -51,8 +51,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 );