Bug 29393: Use patron language in letters

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Alex Arnaud 2021-11-08 15:16:17 +01:00 committed by Katrin Fischer
parent ba3f704493
commit 48948dc9fa
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ use C4::Auth qw( get_template_and_user );
use C4::Output;
use C4::Letters;
use Koha::Patron::Message;
use Koha::Patrons;
my $input = CGI->new;
@ -60,6 +61,7 @@ elsif( $op eq 'cud-add_message' ) {
message => $borrower_message,
}
)->store;
}
if ( $message_type eq 'E' ) {
@ -68,10 +70,13 @@ elsif( $op eq 'cud-add_message' ) {
content => $borrower_message
};
my $patron = Koha::Patrons->find( $borrowernumber );
if ( $letter_code ) {
$letter = C4::Letters::GetPreparedLetter(
module => 'members',
letter_code => $letter_code,
lang => $patron->lang,
tables => {
'borrowers' => $borrowernumber
},