Lines 638-649
sub GetPreparedLetter {
Link Here
|
638 |
$letter->{'content-type'} = 'text/html; charset="UTF-8"' if $letter->{is_html}; |
638 |
$letter->{'content-type'} = 'text/html; charset="UTF-8"' if $letter->{is_html}; |
639 |
} |
639 |
} |
640 |
|
640 |
|
|
|
641 |
my $objects = $params{objects} || {}; |
641 |
my $tables = $params{tables} || {}; |
642 |
my $tables = $params{tables} || {}; |
642 |
my $substitute = $params{substitute} || {}; |
643 |
my $substitute = $params{substitute} || {}; |
643 |
my $loops = $params{loops} || {}; # loops is not supported for historical notices syntax |
644 |
my $loops = $params{loops} || {}; # loops is not supported for historical notices syntax |
644 |
my $repeat = $params{repeat}; |
645 |
my $repeat = $params{repeat}; |
645 |
%$tables || %$substitute || $repeat || %$loops |
646 |
%$tables || %$substitute || $repeat || %$loops || %$objects |
646 |
or carp( "ERROR: nothing to substitute - both 'tables', 'loops' and 'substitute' are empty" ), |
647 |
or carp( "ERROR: nothing to substitute - all of 'objects', 'tables', 'loops' and 'substitute' are empty" ), |
647 |
return; |
648 |
return; |
648 |
my $want_librarian = $params{want_librarian}; |
649 |
my $want_librarian = $params{want_librarian}; |
649 |
|
650 |
|
Lines 718-737
sub GetPreparedLetter {
Link Here
|
718 |
|
719 |
|
719 |
$letter->{content} = _process_tt( |
720 |
$letter->{content} = _process_tt( |
720 |
{ |
721 |
{ |
721 |
content => $letter->{content}, |
722 |
content => $letter->{content}, |
722 |
tables => $tables, |
723 |
lang => $lang, |
723 |
loops => $loops, |
724 |
loops => $loops, |
|
|
725 |
objects => $objects, |
724 |
substitute => $substitute, |
726 |
substitute => $substitute, |
725 |
lang => $lang |
727 |
tables => $tables, |
726 |
} |
728 |
} |
727 |
); |
729 |
); |
728 |
|
730 |
|
729 |
$letter->{title} = _process_tt( |
731 |
$letter->{title} = _process_tt( |
730 |
{ |
732 |
{ |
731 |
content => $letter->{title}, |
733 |
content => $letter->{title}, |
732 |
tables => $tables, |
734 |
lang => $lang, |
733 |
loops => $loops, |
735 |
loops => $loops, |
|
|
736 |
objects => $objects, |
734 |
substitute => $substitute, |
737 |
substitute => $substitute, |
|
|
738 |
tables => $tables, |
735 |
} |
739 |
} |
736 |
); |
740 |
); |
737 |
|
741 |
|
Lines 1616-1624
sub _set_message_status {
Link Here
|
1616 |
sub _process_tt { |
1620 |
sub _process_tt { |
1617 |
my ( $params ) = @_; |
1621 |
my ( $params ) = @_; |
1618 |
|
1622 |
|
1619 |
my $content = $params->{content}; |
1623 |
my $content = $params->{content}; |
1620 |
my $tables = $params->{tables}; |
1624 |
my $tables = $params->{tables}; |
1621 |
my $loops = $params->{loops}; |
1625 |
my $loops = $params->{loops}; |
|
|
1626 |
my $objects = $params->{objects}; |
1622 |
my $substitute = $params->{substitute} || {}; |
1627 |
my $substitute = $params->{substitute} || {}; |
1623 |
my $lang = defined($params->{lang}) && $params->{lang} ne 'default' ? $params->{lang} : 'en'; |
1628 |
my $lang = defined($params->{lang}) && $params->{lang} ne 'default' ? $params->{lang} : 'en'; |
1624 |
my ($theme, $availablethemes); |
1629 |
my ($theme, $availablethemes); |
Lines 1645-1651
sub _process_tt {
Link Here
|
1645 |
} |
1650 |
} |
1646 |
) or die Template->error(); |
1651 |
) or die Template->error(); |
1647 |
|
1652 |
|
1648 |
my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute }; |
1653 |
my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute, %$objects }; |
1649 |
|
1654 |
|
1650 |
$content = add_tt_filters( $content ); |
1655 |
$content = add_tt_filters( $content ); |
1651 |
$content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %]$content|; |
1656 |
$content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %]$content|; |