|
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 |
|