From d8b8799355596a960d3c2cabf6bf4e7a04cef00c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 1 Jun 2017 13:52:30 -0300 Subject: [PATCH] Bug 18789: Use Koha::Patron->is_child where needed Test plan: When you are on a page related to a child you should see the "Update child to adult patron" button Signed-off-by: Kyle M Hall Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- circ/circulation.pl | 1 - koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc | 2 +- members/boraccount.pl | 1 - members/mancredit.pl | 1 - members/maninvoice.pl | 1 - members/member-flags.pl | 1 - members/member-password.pl | 1 - members/moremember.pl | 1 - members/printfeercpt.pl | 1 - members/printinvoice.pl | 1 - members/readingrec.pl | 1 - 11 files changed, 1 insertion(+), 11 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 5657bfb525..4ce738c13a 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -618,7 +618,6 @@ if ( $patron ) { patron => $patron, categoryname => $patron->category->description, expiry => $patron->dateexpiry, - is_child => ( $patron->category->category_type eq 'C' ), ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index be1682bd3c..59d4c0d2ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -69,7 +69,7 @@ [% ELSE %]
  • Delete
  • [% END %] - [% IF ( is_child ) %] + [% IF ( patron.is_child ) %]
  • Update child to adult patron
  • [% ELSE %]
  • Update child to adult patron
  • diff --git a/members/boraccount.pl b/members/boraccount.pl index f4bf63f45f..d30dfe34fd 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -111,7 +111,6 @@ $template->param( finesview => 1, total => sprintf("%.2f",$total), totalcredit => $totalcredit, - is_child => ($patron->category->category_type eq 'C'), reverse_col => $reverse_col, accounts => $accts, ); diff --git a/members/mancredit.pl b/members/mancredit.pl index fe7c24be05..b1de0cc497 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -99,7 +99,6 @@ if ($add){ $template->param( finesview => 1, - is_child => ($patron->category->category_type eq 'C'), # FIXME is_child should be a Koha::Patron method ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 22711649dd..67001884a4 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -126,7 +126,6 @@ if ($add){ $template->param( patron => $patron, finesview => 1, - is_child => ($patron->category->category_type eq 'C'), ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/member-flags.pl b/members/member-flags.pl index bc6237e4b0..66debb66af 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -200,7 +200,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { $template->param( patron => $patron, loop => \@loop, - is_child => ( $category_type eq 'C' ), csrf_token => Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), ); diff --git a/members/member-password.pl b/members/member-password.pl index 6a078258bd..1a56dad41b 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -114,7 +114,6 @@ if ( C4::Context->preference('ExtendedPatronAttributes') ) { $template->param( patron => $patron, destination => $destination, - is_child => ( $category_type eq 'C' ), csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }), ); diff --git a/members/moremember.pl b/members/moremember.pl index be981f99ab..8550dee70e 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -353,7 +353,6 @@ $template->param( totaldue_raw => $total, overdues_exist => $overdues_exist, StaffMember => $category_type eq 'S', - is_child => $category_type eq 'C', $category_type => 1, # [% IF ( I ) %] = institutional/organisation samebranch => $samebranch, quickslip => $quickslip, diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl index 8979ae6c19..da02121567 100755 --- a/members/printfeercpt.pl +++ b/members/printfeercpt.pl @@ -121,7 +121,6 @@ $template->param( finesview => 1, total => sprintf("%.2f",$total), totalcredit => $totalcredit, - is_child => ($category->category_type eq 'C'), accounts => \@accountrows ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/printinvoice.pl b/members/printinvoice.pl index 7b110e9a19..0a36d22c50 100755 --- a/members/printinvoice.pl +++ b/members/printinvoice.pl @@ -121,7 +121,6 @@ $template->param( finesview => 1, total => sprintf( "%.2f", $total ), totalcredit => $totalcredit, - is_child => ( $category->category_type eq 'C' ), accounts => \@accountrows ); diff --git a/members/readingrec.pl b/members/readingrec.pl index 327c5732d1..a8eaffef2b 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -115,7 +115,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { $template->param( patron => $patron, readingrecordview => 1, - is_child => ( $category->category_type eq 'C' ), loop_reading => $issues, ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5