From e2d4b5b4cd42d7210e9671a8585287cd15e78489 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 18 Jun 2020 16:12:08 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); + }, + }; -- 2.11.0