Lines 689-703
sub GetPreparedLetter {
Link Here
|
689 |
or warn( "No $module $letter_code letter transported by " . $mtt ), |
689 |
or warn( "No $module $letter_code letter transported by " . $mtt ), |
690 |
return; |
690 |
return; |
691 |
|
691 |
|
692 |
my $tables = $params{tables}; |
692 |
my $tables = $params{tables} || {}; |
693 |
my $substitute = $params{substitute}; |
693 |
my $substitute = $params{substitute} || {}; |
694 |
my $repeat = $params{repeat}; |
694 |
my $repeat = $params{repeat}; |
695 |
$tables || $substitute || $repeat |
695 |
%$tables || %$substitute || $repeat |
696 |
or carp( "ERROR: nothing to substitute - both 'tables' and 'substitute' are empty" ), |
696 |
or carp( "ERROR: nothing to substitute - both 'tables' and 'substitute' are empty" ), |
697 |
return; |
697 |
return; |
698 |
my $want_librarian = $params{want_librarian}; |
698 |
my $want_librarian = $params{want_librarian}; |
699 |
|
699 |
|
700 |
if ($substitute) { |
700 |
if (%$substitute) { |
701 |
while ( my ($token, $val) = each %$substitute ) { |
701 |
while ( my ($token, $val) = each %$substitute ) { |
702 |
if ( $token eq 'items.content' ) { |
702 |
if ( $token eq 'items.content' ) { |
703 |
$val =~ s|\n|<br/>|g if $letter->{is_html}; |
703 |
$val =~ s|\n|<br/>|g if $letter->{is_html}; |
Lines 743-749
sub GetPreparedLetter {
Link Here
|
743 |
} |
743 |
} |
744 |
} |
744 |
} |
745 |
|
745 |
|
746 |
if ($tables) { |
746 |
if (%$tables) { |
747 |
_substitute_tables( $letter, $tables ); |
747 |
_substitute_tables( $letter, $tables ); |
748 |
} |
748 |
} |
749 |
|
749 |
|
750 |
- |
|
|