|
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 178-184
if ( $total_paid and $total_paid ne '0.00' ) {
Link Here
|
| 178 |
$total_paid = '0.00'; #TODO not right with pay_individual |
177 |
$total_paid = '0.00'; #TODO not right with pay_individual |
| 179 |
} |
178 |
} |
| 180 |
|
179 |
|
| 181 |
borrower_add_additional_fields($borrower, $template); |
180 |
if ( $patron->is_child ) { |
|
|
181 |
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']} ); |
| 182 |
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; |
| 183 |
$template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; |
| 184 |
} |
| 182 |
|
185 |
|
| 183 |
$template->param(%$borrower); |
186 |
$template->param(%$borrower); |
| 184 |
|
187 |
|
|
Lines 186-213
$template->param(
Link Here
|
| 186 |
borrowernumber => $borrowernumber, # some templates require global |
189 |
borrowernumber => $borrowernumber, # some templates require global |
| 187 |
patron => $patron, |
190 |
patron => $patron, |
| 188 |
total => $total_due, |
191 |
total => $total_due, |
| 189 |
ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'), |
|
|
| 190 |
|
192 |
|
| 191 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
193 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
| 192 |
); |
194 |
); |
| 193 |
|
195 |
|
| 194 |
output_html_with_http_headers $input, $cookie, $template->output; |
196 |
output_html_with_http_headers $input, $cookie, $template->output; |
| 195 |
|
197 |
|
| 196 |
sub borrower_add_additional_fields { |
|
|
| 197 |
my ( $b_ref, $template ) = @_; |
| 198 |
|
| 199 |
# some borrower info is not returned in the standard call despite being assumed |
| 200 |
# in a number of templates. It should not be the business of this script but in lieu of |
| 201 |
# a revised api here it is ... |
| 202 |
if ( $b_ref->{category_type} eq 'C' ) { |
| 203 |
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); |
| 204 |
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; |
| 205 |
$template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; |
| 206 |
} |
| 207 |
|
| 208 |
if (C4::Context->preference('ExtendedPatronAttributes')) { |
| 209 |
$b_ref->{extendedattributes} = GetBorrowerAttributes($b_ref->{borrowernumber}); |
| 210 |
} |
| 211 |
|
| 212 |
return; |
| 213 |
} |