From: Galen Charlton Date: Thu, 18 Jun 2020 20:12:08 +0000 (-0400) Subject: LP#1851306: (follow-up) add get_org_unit() helper to print templates X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e2d4b5b4cd42d7210e9671a8585287cd15e78489;p=contrib%2FConifer.git LP#1851306: (follow-up) add get_org_unit() helper to print templates The immediate use case is allowing the destination library's shortname to print on booking capture slips. Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm index be76da0ce4..47dc807c29 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm @@ -208,7 +208,14 @@ $helpers = { my $tz = shift || 'local'; my $date = DateTime->now(time_zone => $tz); return $helpers->{format_date}->($date); - } + }, + + get_org_unit => sub { + my $org_id = shift; + return $org_id if ref $org_id; + return new_editor()->retrieve_actor_org_unit($org_id); + }, + };