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 <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-05-07 17:48:24 +01:00 committed by Katrin Fischer
parent f625baeef0
commit 6c29984598
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -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' ) {