From: Bernd Bleßmann Date: Fri, 19 Mar 2021 13:10:49 +0000 (+0100) Subject: S:P:Dunning: Link mit link_tag erzeugen X-Git-Tag: kivitendo-mebil_0.1-0~9^2~409 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=91e4e0fcf4149e7353c4f255775f969dde1a94f8;p=kivitendo-erp.git S:P:Dunning: Link mit link_tag erzeugen --- diff --git a/SL/Presenter/Dunning.pm b/SL/Presenter/Dunning.pm index dacc7a7ad..a40239fa0 100644 --- a/SL/Presenter/Dunning.pm +++ b/SL/Presenter/Dunning.pm @@ -3,6 +3,7 @@ package SL::Presenter::Dunning; use strict; use SL::Presenter::EscapedText qw(escape is_escaped); +use SL::Presenter::Tag qw(link_tag); use Exporter qw(import); our @EXPORT_OK = qw(dunning); @@ -18,11 +19,12 @@ sub dunning { my $invoice = SL::DB::Manager::Invoice->find_by( id => $dunning->trans_id ); - my $text = join '', ( - $params{no_link} ? '' : '', - escape($dunning->dunning_config->dunning_description), - $params{no_link} ? '' : '', - ); + my $text = escape($dunning->dunning_config->dunning_description); + + if (! delete $params{no_link}) { + my $href = 'dn.pl?action=print_dunning&format=pdf&media=screen&dunning_id=' . $dunning->dunning_id . '&language_id=' . $invoice->language_id; + $text = link_tag($href, $text, %params); + } is_escaped($text); }