From 6c2998459875f7c0429b8de9315b02c443e955ad 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 Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- C4/Letters.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Letters.pm b/C4/Letters.pm index 827b5d1087..497b97dab9 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -625,6 +625,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.5