From 7536b7af1c62df53d0a8244bb74c46a4d8b50352 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 7 Mar 2024 11:02:01 +0000 Subject: [PATCH] Bug 36270: Remove borrower-attribute:code from <<>> notices We need to replace this with a TT alternative however :| --- C4/Letters.pm | 20 -------------------- tools/letter.pl | 12 ------------ 2 files changed, 32 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index a0404ac7075..fab7dc145e0 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -873,26 +873,6 @@ sub _parseletter { } } - if ($table eq 'borrowers' && $letter->{content}) { - my $patron = Koha::Patrons->find( $values->{borrowernumber} ); - if ( $patron ) { - my $attributes = $patron->extended_attributes; - my %attr; - while ( my $attribute = $attributes->next ) { - my $code = $attribute->code; - my $val = $attribute->description; # FIXME - we always display intranet description here! - $val =~ s/\p{P}(?=$)//g if $val; - next unless $val gt ''; - $attr{$code} ||= []; - push @{ $attr{$code} }, $val; - } - while ( my ($code, $val_ar) = each %attr ) { - my $replacefield = "<>"; - my $replacedby = join ',', @$val_ar; - $letter->{content} =~ s/$replacefield/$replacedby/g; - } - } - } return $letter; } diff --git a/tools/letter.pl b/tools/letter.pl index 0ecab147b0e..ea1e3fcd372 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -517,17 +517,5 @@ sub get_columns_for { text => $table_prefix . $row->{Field}, } } - if ($table eq 'borrowers') { - my $attribute_types = Koha::Patron::Attribute::Types->search( - {}, - { order_by => 'code' }, - ); - while ( my $at = $attribute_types->next ) { - push @fields, { - value => "borrower-attribute:" . $at->code, - text => "attribute:" . $at->code, - } - } - } return @fields; } -- 2.44.0