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

(-)a/C4/Letters.pm (-20 lines)
Lines 873-898 sub _parseletter { Link Here
873
        }
873
        }
874
    }
874
    }
875
875
876
    if ($table eq 'borrowers' && $letter->{content}) {
877
        my $patron = Koha::Patrons->find( $values->{borrowernumber} );
878
        if ( $patron ) {
879
            my $attributes = $patron->extended_attributes;
880
            my %attr;
881
            while ( my $attribute = $attributes->next ) {
882
                my $code = $attribute->code;
883
                my $val  = $attribute->description; # FIXME - we always display intranet description here!
884
                $val =~ s/\p{P}(?=$)//g if $val;
885
                next unless $val gt '';
886
                $attr{$code} ||= [];
887
                push @{ $attr{$code} }, $val;
888
            }
889
            while ( my ($code, $val_ar) = each %attr ) {
890
                my $replacefield = "<<borrower-attribute:$code>>";
891
                my $replacedby   = join ',', @$val_ar;
892
                $letter->{content} =~ s/$replacefield/$replacedby/g;
893
            }
894
        }
895
    }
896
    return $letter;
876
    return $letter;
897
}
877
}
898
878
(-)a/tools/letter.pl (-13 lines)
Lines 517-533 sub get_columns_for { Link Here
517
            text  => $table_prefix . $row->{Field},
517
            text  => $table_prefix . $row->{Field},
518
        }
518
        }
519
    }
519
    }
520
    if ($table eq 'borrowers') {
521
        my $attribute_types = Koha::Patron::Attribute::Types->search(
522
            {},
523
            { order_by => 'code' },
524
        );
525
        while ( my $at = $attribute_types->next ) {
526
            push @fields, {
527
                value => "borrower-attribute:" . $at->code,
528
                text  => "attribute:" . $at->code,
529
            }
530
        }
531
    }
532
    return @fields;
520
    return @fields;
533
}
521
}
534
- 

Return to bug 36270