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

(-)a/C4/Auth_with_ldap.pm (-2 / +4 lines)
Lines 231-237 sub checkpw_ldap { Link Here
231
        return 0;   # B2, D2
231
        return 0;   # B2, D2
232
    }
232
    }
233
    if (C4::Context->preference('ExtendedPatronAttributes') && $borrowernumber && ($config{update} ||$config{replicate})) {
233
    if (C4::Context->preference('ExtendedPatronAttributes') && $borrowernumber && ($config{update} ||$config{replicate})) {
234
        my $attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations;
234
        my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
235
        my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id);
235
        while ( my $attribute_type = $attribute_types->next ) {
236
        while ( my $attribute_type = $attribute_types->next ) {
236
            my $code = $attribute_type->code;
237
            my $code = $attribute_type->code;
237
            unless (exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) {
238
            unless (exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) {
Lines 374-380 sub update_local { Link Here
374
    # skip extended patron attributes in 'borrowers' attribute update
375
    # skip extended patron attributes in 'borrowers' attribute update
375
    my @keys = keys %$borrower;
376
    my @keys = keys %$borrower;
376
    if (C4::Context->preference('ExtendedPatronAttributes')) {
377
    if (C4::Context->preference('ExtendedPatronAttributes')) {
377
        my $attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations;
378
        my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
379
        my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id);
378
        while ( my $attribute_type = $attribute_types->next ) {
380
        while ( my $attribute_type = $attribute_types->next ) {
379
           my $code = $attribute_type->code;
381
           my $code = $attribute_type->code;
380
           @keys = grep { $_ ne $code } @keys;
382
           @keys = grep { $_ ne $code } @keys;
(-)a/members/memberentry.pl (-1 / +2 lines)
Lines 853-859 sub patron_attributes_form { Link Here
853
    my $borrowernumber = shift;
853
    my $borrowernumber = shift;
854
    my $op = shift;
854
    my $op = shift;
855
855
856
    my $attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations;
856
    my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
857
    my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id);
857
    if ( $attribute_types->count == 0 ) {
858
    if ( $attribute_types->count == 0 ) {
858
        $template->param(no_patron_attribute_types => 1);
859
        $template->param(no_patron_attribute_types => 1);
859
        return;
860
        return;
(-)a/members/moremember.pl (-1 / +2 lines)
Lines 154-160 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
154
        attributes_loop => \@attributes_loop
154
        attributes_loop => \@attributes_loop
155
    );
155
    );
156
156
157
    my $nb_of_attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations->count;
157
    my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
158
    my $nb_of_attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id)->count;
158
    if ( $nb_of_attribute_types == 0 ) {
159
    if ( $nb_of_attribute_types == 0 ) {
159
        $template->param(no_patron_attribute_types => 1);
160
        $template->param(no_patron_attribute_types => 1);
160
    }
161
    }
(-)a/reports/borrowers_stats.pl (-1 / +2 lines)
Lines 495-501 sub parse_extended_patron_attributes { Link Here
495
sub patron_attributes_form {
495
sub patron_attributes_form {
496
    my $template = shift;
496
    my $template = shift;
497
497
498
    my $attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations;
498
    my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
499
    my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id);
499
500
500
    my %items_by_class;
501
    my %items_by_class;
501
    while ( my $attr_type = $attribute_types->next ) {
502
    while ( my $attr_type = $attribute_types->next ) {
(-)a/reports/issues_stats.pl (-1 / +2 lines)
Lines 166-172 foreach (sort {$ccodes->{$a} cmp $ccodes->{$b}} keys %$ccodes) { Link Here
166
my $CGIextChoice = ( 'CSV' ); # FIXME translation
166
my $CGIextChoice = ( 'CSV' ); # FIXME translation
167
my $CGIsepChoice=GetDelimiterChoices;
167
my $CGIsepChoice=GetDelimiterChoices;
168
168
169
my $attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations;
169
my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
170
my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id);
170
my %attribute_types_by_class;
171
my %attribute_types_by_class;
171
while ( my ( $attribute_type ) = $attribute_types->next ) {
172
while ( my ( $attribute_type ) = $attribute_types->next ) {
172
    $attribute_type = $attribute_type->unblessed;
173
    $attribute_type = $attribute_type->unblessed;
(-)a/tools/modborrowers.pl (-2 / +2 lines)
Lines 113-119 if ( $op eq 'show' ) { Link Here
113
    # Construct the patron attributes list
113
    # Construct the patron attributes list
114
    my @patron_attributes_values;
114
    my @patron_attributes_values;
115
    my @patron_attributes_codes;
115
    my @patron_attributes_codes;
116
    my $patron_attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations;
116
    my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
117
    my $patron_attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id);
117
    my @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']});
118
    my @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']});
118
    while ( my $attr_type = $patron_attribute_types->next ) {
119
    while ( my $attr_type = $patron_attribute_types->next ) {
119
        # TODO Repeatable attributes are not correctly managed and can cause data lost.
120
        # TODO Repeatable attributes are not correctly managed and can cause data lost.
120
- 

Return to bug 20443