Lines 637-648
sub GetPreparedLetter {
Link Here
|
637 |
$letter->{'content-type'} = 'text/html; charset="UTF-8"' if $letter->{is_html}; |
637 |
$letter->{'content-type'} = 'text/html; charset="UTF-8"' if $letter->{is_html}; |
638 |
} |
638 |
} |
639 |
|
639 |
|
|
|
640 |
my $objects = $params{objects} || {}; |
640 |
my $tables = $params{tables} || {}; |
641 |
my $tables = $params{tables} || {}; |
641 |
my $substitute = $params{substitute} || {}; |
642 |
my $substitute = $params{substitute} || {}; |
642 |
my $loops = $params{loops} || {}; # loops is not supported for historical notices syntax |
643 |
my $loops = $params{loops} || {}; # loops is not supported for historical notices syntax |
643 |
my $repeat = $params{repeat}; |
644 |
my $repeat = $params{repeat}; |
644 |
%$tables || %$substitute || $repeat || %$loops |
645 |
%$tables || %$substitute || $repeat || %$loops || %$objects |
645 |
or carp( "ERROR: nothing to substitute - both 'tables', 'loops' and 'substitute' are empty" ), |
646 |
or carp( "ERROR: nothing to substitute - all of 'objects', 'tables', 'loops' and 'substitute' are empty" ), |
646 |
return; |
647 |
return; |
647 |
my $want_librarian = $params{want_librarian}; |
648 |
my $want_librarian = $params{want_librarian}; |
648 |
|
649 |
|
Lines 717-736
sub GetPreparedLetter {
Link Here
|
717 |
|
718 |
|
718 |
$letter->{content} = _process_tt( |
719 |
$letter->{content} = _process_tt( |
719 |
{ |
720 |
{ |
720 |
content => $letter->{content}, |
721 |
content => $letter->{content}, |
721 |
tables => $tables, |
722 |
lang => $lang, |
722 |
loops => $loops, |
723 |
loops => $loops, |
|
|
724 |
objects => $objects, |
723 |
substitute => $substitute, |
725 |
substitute => $substitute, |
724 |
lang => $lang |
726 |
tables => $tables, |
725 |
} |
727 |
} |
726 |
); |
728 |
); |
727 |
|
729 |
|
728 |
$letter->{title} = _process_tt( |
730 |
$letter->{title} = _process_tt( |
729 |
{ |
731 |
{ |
730 |
content => $letter->{title}, |
732 |
content => $letter->{title}, |
731 |
tables => $tables, |
733 |
lang => $lang, |
732 |
loops => $loops, |
734 |
loops => $loops, |
|
|
735 |
objects => $objects, |
733 |
substitute => $substitute, |
736 |
substitute => $substitute, |
|
|
737 |
tables => $tables, |
734 |
} |
738 |
} |
735 |
); |
739 |
); |
736 |
|
740 |
|
Lines 1552-1560
sub _set_message_status {
Link Here
|
1552 |
sub _process_tt { |
1556 |
sub _process_tt { |
1553 |
my ( $params ) = @_; |
1557 |
my ( $params ) = @_; |
1554 |
|
1558 |
|
1555 |
my $content = $params->{content}; |
1559 |
my $content = $params->{content}; |
1556 |
my $tables = $params->{tables}; |
1560 |
my $tables = $params->{tables}; |
1557 |
my $loops = $params->{loops}; |
1561 |
my $loops = $params->{loops}; |
|
|
1562 |
my $objects = $params->{objects}; |
1558 |
my $substitute = $params->{substitute} || {}; |
1563 |
my $substitute = $params->{substitute} || {}; |
1559 |
my $lang = defined($params->{lang}) && $params->{lang} ne 'default' ? $params->{lang} : 'en'; |
1564 |
my $lang = defined($params->{lang}) && $params->{lang} ne 'default' ? $params->{lang} : 'en'; |
1560 |
my ($theme, $availablethemes); |
1565 |
my ($theme, $availablethemes); |
Lines 1581-1587
sub _process_tt {
Link Here
|
1581 |
} |
1586 |
} |
1582 |
) or die Template->error(); |
1587 |
) or die Template->error(); |
1583 |
|
1588 |
|
1584 |
my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute }; |
1589 |
my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute, %$objects }; |
1585 |
|
1590 |
|
1586 |
$content = add_tt_filters( $content ); |
1591 |
$content = add_tt_filters( $content ); |
1587 |
$content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %]$content|; |
1592 |
$content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %]$content|; |