From c5cf483fa2eaead2d911b0fca985d716b51c15c5 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 7 May 2024 17:48:24 +0100 Subject: [PATCH] Bug 36758: Add librarian object This patch adds a 'librarian' object fetch to C4::Letters::GetPreparedLetter when a called passes the 'want_librarian' flag. This allows for the notice to take full advantage of the patron object for that librarian rather than requireing old non-TT syntax for this feature. Test plan 1) We use the 'librarian' object in the new TICKET_ASSIGNED default notice, use the next patch to test that the librarian title is correctly substituted into the notice. Signed-off-by: David Nind --- C4/Letters.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Letters.pm b/C4/Letters.pm index dc1db2190b..0fd166ee68 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -618,6 +618,9 @@ sub GetPreparedLetter { or carp( "ERROR: nothing to substitute - all of 'objects', 'tables', 'loops' and 'substitute' are empty" ), return; my $want_librarian = $params{want_librarian}; + if ($want_librarian) { + $objects->{librarian} = Koha::Patrons->find( C4::Context->userenv->{number} ); + } # Best guess at language 'default' notice is written for include handling if ( $lang eq 'default' ) { -- 2.39.2