}
-# FIXME: using our here means that a Plack server will need to be
-# restarted fairly regularly when working with this routine.
-# A better option would be to use Koha::Cache and use a cache
-# that actually works in a persistent environment, but as a
-# short-term fix, our will work.
-our %letter;
sub getletter {
my ( $module, $code, $branchcode, $message_transport_type ) = @_;
$message_transport_type //= '%';
}
$branchcode //= '';
- if ( my $l = $letter{$module}{$code}{$branchcode}{$message_transport_type} ) {
- return { %$l }; # deep copy
- }
-
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare(q{
SELECT *
my $line = $sth->fetchrow_hashref
or return;
$line->{'content-type'} = 'text/html; charset="UTF-8"' if $line->{is_html};
- $letter{$module}{$code}{$branchcode}{$message_transport_type} = $line;
return { %$line };
}