Bug 18423 - Followup - enable Add child button for institutional borrowers
authorNick Clemens <nick@bywatersolutions.com>
Tue, 18 Apr 2017 18:03:37 +0000 (14:03 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 21 Apr 2017 11:42:58 +0000 (07:42 -0400)
If they can have guarantors and we shwo the button on one page I think
we should in fact show it on all.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
16 files changed:
members/boraccount.pl
members/deletemem.pl
members/files.pl
members/housebound.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/notices.pl
members/pay.pl
members/paycollect.pl
members/printfeercpt.pl
members/printinvoice.pl
members/readingrec.pl
members/routing-lists.pl
members/statistics.pl

index 4cf9095..4f8ddf0 100755 (executable)
@@ -92,7 +92,7 @@ foreach my $accountline ( @{$accts}) {
     }
 }
 
-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
 
 my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
 $template->param( picture => 1 ) if $patron_image;
index 0d0ba64..00d21f0 100755 (executable)
@@ -110,7 +110,7 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'}  or $is_
     my $patron_image = Koha::Patron::Images->find($bor->{borrowernumber});
     $template->param( picture => 1 ) if $patron_image;
 
-    $template->param( adultborrower => 1 ) if ( $bor->{category_type} eq 'A' );
+    $template->param( adultborrower => 1 ) if ( $bor->{category_type} eq 'A' || $bor->{category_type} eq 'I' );
 
     $template->param(borrowernumber => $member,
         surname => $bor->{'surname'},
index 1d99bcf..5002c3e 100755 (executable)
@@ -117,7 +117,7 @@ else {
     my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
     $template->param( picture => 1 ) if $patron_image;
 
-    $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' );
+    $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' || $data->{category_type} eq 'I' );
     $template->param(
         files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
           ->GetFilesInfo(),
index 0b571e6..def6c57 100755 (executable)
@@ -171,7 +171,7 @@ if ( C4::Context->preference('ExtendedPatronAttributes') and $patron ) {
     );
 }
 
-$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' );
+$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' );
 $template->param(
     picture            => $patron_image,
     housebound_profile => $houseboundprofile,
index 8150b7f..f8a3681 100755 (executable)
@@ -80,7 +80,7 @@ if ($add){
         $template->param( 'catcode' => $patron_categories->next )  if $patron_categories->count == 1;
     }
 
-    $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' );
+    $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' || $data->{category_type} eq 'I' );
     my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
     $template->param( picture => 1 ) if $patron_image;
 
index 86c9506..e69a1ca 100755 (executable)
@@ -106,7 +106,7 @@ if ($add){
         $template->param( 'catcode' => $patron_categories->next )  if $patron_categories->count == 1;
     }
 
-    $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
+    $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
     my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
     $template->param( picture => 1 ) if $patron_image;
 
index b89707e..95f5330 100755 (executable)
@@ -176,7 +176,7 @@ if ($input->param('newflags')) {
         $template->param( 'catcode' => $patron_categories->next )  if $patron_categories->count == 1;
     }
        
-$template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' || $bor->{'category_type'} eq 'I' );
     my $patron_image = Koha::Patron::Images->find($bor->{borrowernumber});
     $template->param( picture => 1 ) if $patron_image;
 
index 1625e32..2d9b2cc 100755 (executable)
@@ -105,7 +105,7 @@ if ( $bor->{'category_type'} eq 'C') {
     $template->param( 'catcode' => $patron_categories->next )  if $patron_categories->count == 1;
 }
 
-$template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' || $bor->{'category_type'} eq 'I' );
 
 my $patron_image = Koha::Patron::Images->find($bor->{borrowernumber});
 $template->param( picture => 1 ) if $patron_image;
index 2285bb8..58d4f6e 100755 (executable)
@@ -73,7 +73,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
 }
 
 $template->param(%$borrower);
-$template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' );
 $template->param(
     QUEUED_MESSAGES    => $queued_messages,
     borrowernumber     => $borrowernumber,
index 9bf470e..2e25eef 100755 (executable)
@@ -231,7 +231,7 @@ sub borrower_add_additional_fields {
         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 )  if $patron_categories->count == 1;
-    } elsif ( $b_ref->{category_type} eq 'A' ) {
+    } elsif ( $b_ref->{category_type} eq 'A' || $b_ref->{category_type} eq 'I' ) {
         $b_ref->{adultborrower} = 1;
     }
 
index 2089006..9784e88 100755 (executable)
@@ -191,7 +191,7 @@ sub borrower_add_additional_fields {
         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 )  if $patron_categories->count == 1;
-    } elsif ( $b_ref->{category_type} eq 'A' ) {
+    } elsif ( $b_ref->{category_type} eq 'A' || $b_ref->{category_type} eq 'I' ) {
         $b_ref->{adultborrower} = 1;
     }
 
index c92dbd6..4351aae 100755 (executable)
@@ -112,7 +112,7 @@ for (my $i=0;$i<$numaccts;$i++){
     push(@accountrows, \%row);
 }
 
-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
 
 my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
 $template->param( picture => 1 ) if $patron_image;
index 252c241..77f3156 100755 (executable)
@@ -112,7 +112,7 @@ for ( my $i = 0 ; $i < $numaccts ; $i++ ) {
     push( @accountrows, \%row );
 }
 
-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
 
 my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
 $template->param( picture => 1 ) if $patron_image;
index bb4b316..9daf48c 100755 (executable)
@@ -101,7 +101,7 @@ if ( $data->{'category_type'} eq 'C') {
     $template->param( 'catcode' => $patron_categories->next )  if $patron_categories->count == 1;
 }
 
-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
 if (! $limit){
        $limit = 'full';
 }
index 63cc3da..c3e6c8d 100755 (executable)
@@ -80,7 +80,7 @@ if ($borrowernumber) {
         routinglistview => 1
     );
 
-    $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
+    $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' || $borrower->{'category_type'} eq 'I' );
 }
 
 ##################################################################################
index a59ce7b..a63d328 100755 (executable)
@@ -97,7 +97,7 @@ $template->param( picture => 1 ) if $patron_image;
 
 $template->param(%$borrower);
 
-$template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' );
+$template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' );
 
 $template->param(
     statisticsview     => 1,