Commit f6155d98 authored by joubu's avatar joubu

Bug 17981: Add a 'letter' param to GetPreparedLetter

This will allow us to call GetPreparedLetter with a letter content that
does not exist in the DB
Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec's avatarJosef Moravec <josef.moravec@gmail.com>
Signed-off-by: joubu's avatarJonathan Druart <jonathan.druart@bugs.koha-community.org>
parent e3f69fc1
......@@ -688,18 +688,22 @@ sub SendAlerts {
sub GetPreparedLetter {
my %params = @_;
my $module = $params{module} or croak "No module";
my $letter_code = $params{letter_code} or croak "No letter_code";
my $branchcode = $params{branchcode} || '';
my $mtt = $params{message_transport_type} || 'email';
my $lang = $params{lang} || 'default';
my $letter = getletter( $module, $letter_code, $branchcode, $mtt, $lang );
my $letter = $params{letter};
unless ( $letter ) {
$letter = getletter( $module, $letter_code, $branchcode, $mtt, 'default' )
or warn( "No $module $letter_code letter transported by " . $mtt ),
return;
my $module = $params{module} or croak "No module";
my $letter_code = $params{letter_code} or croak "No letter_code";
my $branchcode = $params{branchcode} || '';
my $mtt = $params{message_transport_type} || 'email';
my $lang = $params{lang} || 'default';
$letter = getletter( $module, $letter_code, $branchcode, $mtt, $lang );
unless ( $letter ) {
$letter = getletter( $module, $letter_code, $branchcode, $mtt, 'default' )
or warn( "No $module $letter_code letter transported by " . $mtt ),
return;
}
}
my $tables = $params{tables} || {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment