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 <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-06-01 13:52:30 -03:00
parent e5f70a6010
commit d8b8799355
11 changed files with 1 additions and 11 deletions

View File

@ -618,7 +618,6 @@ if ( $patron ) {
patron => $patron,
categoryname => $patron->category->description,
expiry => $patron->dateexpiry,
is_child => ( $patron->category->category_type eq 'C' ),
);
}

View File

@ -69,7 +69,7 @@
[% ELSE %]
<li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
[% END %]
[% IF ( is_child ) %]
[% IF ( patron.is_child ) %]
<li><a id="updatechild" href="#">Update child to adult patron</a></li>
[% ELSE %]
<li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li>

View File

@ -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,
);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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'), } ),
);

View File

@ -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'), }),
);

View File

@ -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,

View File

@ -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;

View File

@ -121,7 +121,6 @@ $template->param(
finesview => 1,
total => sprintf( "%.2f", $total ),
totalcredit => $totalcredit,
is_child => ( $category->category_type eq 'C' ),
accounts => \@accountrows
);

View File

@ -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;