Lines 79-85
unless ( $patron ) {
Link Here
|
79 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$member"); |
79 |
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$member"); |
80 |
exit; |
80 |
exit; |
81 |
} |
81 |
} |
82 |
my $flags = C4::Members::patronflags( $patron->unblessed ); |
82 |
my $charges = $patron->account->non_issues_charges; |
83 |
my $userenv = C4::Context->userenv; |
83 |
my $userenv = C4::Context->userenv; |
84 |
|
84 |
|
85 |
|
85 |
|
Lines 109-115
if (C4::Context->preference("IndependentBranches")) {
Link Here
|
109 |
my $op = $input->param('op') || 'delete_confirm'; |
109 |
my $op = $input->param('op') || 'delete_confirm'; |
110 |
my $dbh = C4::Context->dbh; |
110 |
my $dbh = C4::Context->dbh; |
111 |
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member); |
111 |
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member); |
112 |
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_guarantor or $deletelocal == 0) { |
112 |
if ( $op eq 'delete_confirm' or $countissues > 0 or $charges or $is_guarantor or $deletelocal == 0) { |
113 |
$template->param( picture => 1 ) if $patron->image; |
113 |
$template->param( picture => 1 ) if $patron->image; |
114 |
|
114 |
|
115 |
$template->param( adultborrower => 1 ) if $patron->category->category_type =~ /^(A|I)$/; |
115 |
$template->param( adultborrower => 1 ) if $patron->category->category_type =~ /^(A|I)$/; |
Lines 136-143
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_
Link Here
|
136 |
if ($countissues >0) { |
136 |
if ($countissues >0) { |
137 |
$template->param(ItemsOnIssues => $countissues); |
137 |
$template->param(ItemsOnIssues => $countissues); |
138 |
} |
138 |
} |
139 |
if ($flags->{'CHARGES'} ne '') { |
139 |
if ( $charges > 0 ) { |
140 |
$template->param(charges => $flags->{'CHARGES'}->{'amount'}); |
140 |
$template->param(charges => $charges); |
141 |
} |
141 |
} |
142 |
if ($is_guarantor) { |
142 |
if ($is_guarantor) { |
143 |
$template->param(guarantees => 1); |
143 |
$template->param(guarantees => 1); |
Lines 146-152
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_
Link Here
|
146 |
$template->param(keeplocal => 1); |
146 |
$template->param(keeplocal => 1); |
147 |
} |
147 |
} |
148 |
# This is silly written but reflect the same conditions as above |
148 |
# This is silly written but reflect the same conditions as above |
149 |
if ( not $countissues > 0 and not $flags->{CHARGES} ne '' and not $is_guarantor and not $deletelocal == 0 ) { |
149 |
if ( not $countissues > 0 and not $charges and not $is_guarantor and not $deletelocal == 0 ) { |
150 |
$template->param( |
150 |
$template->param( |
151 |
op => 'delete_confirm', |
151 |
op => 'delete_confirm', |
152 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
152 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |