|
Lines 25-31
use C4::Context;
Link Here
|
| 25 |
use C4::Auth; |
25 |
use C4::Auth; |
| 26 |
use C4::Output; |
26 |
use C4::Output; |
| 27 |
use C4::Members; |
27 |
use C4::Members; |
| 28 |
use C4::Members::Attributes qw(GetBorrowerAttributes); |
|
|
| 29 |
use C4::Accounts; |
28 |
use C4::Accounts; |
| 30 |
use C4::Koha; |
29 |
use C4::Koha; |
| 31 |
|
30 |
|
|
Lines 180-186
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
| 180 |
$total_paid = '0.00'; #TODO not right with pay_individual |
179 |
$total_paid = '0.00'; #TODO not right with pay_individual |
| 181 |
} |
180 |
} |
| 182 |
|
181 |
|
| 183 |
borrower_add_additional_fields($patron, $template); |
182 |
if ( $patron->is_child ) { |
|
|
183 |
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']} ); |
| 184 |
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; |
| 185 |
$template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; |
| 186 |
} |
| 184 |
|
187 |
|
| 185 |
$template->param(%$borrower); |
188 |
$template->param(%$borrower); |
| 186 |
|
189 |
|
|
Lines 193-221
$template->param(
Link Here
|
| 193 |
borrowernumber => $borrowernumber, # some templates require global |
196 |
borrowernumber => $borrowernumber, # some templates require global |
| 194 |
patron => $patron, |
197 |
patron => $patron, |
| 195 |
total => $total_due, |
198 |
total => $total_due, |
| 196 |
ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'), |
|
|
| 197 |
|
199 |
|
| 198 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
200 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
| 199 |
); |
201 |
); |
| 200 |
|
202 |
|
| 201 |
output_html_with_http_headers $input, $cookie, $template->output; |
203 |
output_html_with_http_headers $input, $cookie, $template->output; |
| 202 |
|
|
|
| 203 |
sub borrower_add_additional_fields { |
| 204 |
my ( $patron, $template ) = @_; |
| 205 |
|
| 206 |
# some borrower info is not returned in the standard call despite being assumed |
| 207 |
# in a number of templates. It should not be the business of this script but in lieu of |
| 208 |
# a revised api here it is ... |
| 209 |
if ( $patron->is_child ) { |
| 210 |
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); |
| 211 |
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; |
| 212 |
$template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; |
| 213 |
} |
| 214 |
|
| 215 |
if (C4::Context->preference('ExtendedPatronAttributes')) { |
| 216 |
my $extendedattributes = GetBorrowerAttributes($patron->borrowernumber); |
| 217 |
$template->param( extendedattributes => $extendedattributes ); |
| 218 |
} |
| 219 |
|
| 220 |
return; |
| 221 |
} |