View | Details | Raw Unified | Return to bug 12159
Collapse All | Expand All

(-)a/Koha/Patron.pm (+29 lines)
Lines 831-836 sub is_child { Link Here
831
    return $self->category->category_type eq 'C' ? 1 : 0;
831
    return $self->category->category_type eq 'C' ? 1 : 0;
832
}
832
}
833
833
834
=head3
835
836
foobar
837
838
=cut
839
840
sub borrower_add_additional_fields {
841
    my ( $self, $template ) = @_;
842
843
# some borrower info is not returned in the standard call despite being assumed
844
# in a number of templates. It should not be the business of this script but in lieu of
845
# a revised api here it is ...
846
    if ( $self->is_child ) {
847
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}    );
848
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
849
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
850
    }
851
852
    if (C4::Context->preference('ExtendedPatronAttributes')) {
853
        my $b_ref = $self->unblessed;
854
        $b_ref->{extendedattributes} = GetBorrowerAttributes($self->borrowernumber);
855
        $template->param(
856
            ExtendedPatronAttributes => 1,
857
        );
858
    }
859
860
    return;
861
}
862
834
=head3 type
863
=head3 type
835
864
836
=cut
865
=cut
(-)a/members/pay.pl (-23 / +1 lines)
Lines 138-144 sub add_accounts_to_template { Link Here
138
        }
138
        }
139
        push @accounts, $account_line;
139
        push @accounts, $account_line;
140
    }
140
    }
141
    borrower_add_additional_fields($patron->unblessed);
141
    $patron->borrower_add_additional_fields($template);
142
142
143
    $template->param(
143
    $template->param(
144
        patron   => $patron,
144
        patron   => $patron,
Lines 215-242 sub writeoff_all { Link Here
215
    return;
215
    return;
216
}
216
}
217
217
218
sub borrower_add_additional_fields {
219
    my $b_ref = shift;
220
221
# some borrower info is not returned in the standard call despite being assumed
222
# in a number of templates. It should not be the business of this script but in lieu of
223
# a revised api here it is ...
224
    if ( $b_ref->{category_type} eq 'C' ) {
225
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
226
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
227
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
228
    }
229
230
    if (C4::Context->preference('ExtendedPatronAttributes')) {
231
        $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
232
        $template->param(
233
            ExtendedPatronAttributes => 1,
234
        );
235
    }
236
237
    return;
238
}
239
240
sub payselected {
218
sub payselected {
241
    my @params = @_;
219
    my @params = @_;
242
    my $amt    = 0;
220
    my $amt    = 0;
(-)a/members/paycollect.pl (-21 / +1 lines)
Lines 170-176 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
170
    $total_paid = '0.00';    #TODO not right with pay_individual
170
    $total_paid = '0.00';    #TODO not right with pay_individual
171
}
171
}
172
172
173
borrower_add_additional_fields($borrower, $template);
173
$patron->borrower_add_additional_fields($template);
174
174
175
$template->param(%$borrower);
175
$template->param(%$borrower);
176
176
Lines 184-205 $template->param( Link Here
184
);
184
);
185
185
186
output_html_with_http_headers $input, $cookie, $template->output;
186
output_html_with_http_headers $input, $cookie, $template->output;
187
188
sub borrower_add_additional_fields {
189
    my ( $b_ref, $template ) = @_;
190
191
# some borrower info is not returned in the standard call despite being assumed
192
# in a number of templates. It should not be the business of this script but in lieu of
193
# a revised api here it is ...
194
    if ( $b_ref->{category_type} eq 'C' ) {
195
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
196
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
197
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
198
    }
199
200
    if (C4::Context->preference('ExtendedPatronAttributes')) {
201
        $b_ref->{extendedattributes} = GetBorrowerAttributes($b_ref->{borrowernumber});
202
    }
203
204
    return;
205
}
206
- 

Return to bug 12159