From 91e4e0fcf4149e7353c4f255775f969dde1a94f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 19 Mar 2021 14:10:49 +0100 Subject: [PATCH] S:P:Dunning: Link mit link_tag erzeugen --- SL/Presenter/Dunning.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); } -- 2.20.1