X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPresenter.pm;h=67e1948e4f33a899c307abe92bb62028badb8877;hb=937e37ad007405c6a3a389ee18006379ffecc073;hp=61ddab4082922064730bfc1fec7efd780715042a;hpb=d093f01c664ae2afaaed1a5b41e65ebc0ac154f3;p=kivitendo-erp.git diff --git a/SL/Presenter.pm b/SL/Presenter.pm index 61ddab408..67e1948e4 100644 --- a/SL/Presenter.pm +++ b/SL/Presenter.pm @@ -14,6 +14,7 @@ use SL::Presenter::Invoice; use SL::Presenter::Order; use SL::Presenter::Project; use SL::Presenter::Record; +use SL::Presenter::SepaExport; use SL::Presenter::Text; use SL::Presenter::Tag; @@ -40,7 +41,7 @@ sub render { } # Only certain types are supported. - croak "Unsupported type: " . $options->{type} unless $options->{type} =~ m/^(?:html|js|json)$/; + croak "Unsupported type: " . $options->{type} unless $options->{type} =~ m/^(?:html|js|json|text)$/; # The "template" argument must be a string or a reference to one. $template = ${ $template } if ((ref($template) || '') eq 'REF') && (ref(${ $template }) eq 'SL::Presenter::EscapedText'); @@ -49,7 +50,8 @@ sub render { # Look for the file given by $template if $template is not a reference. my $source; if (!ref $template) { - $source = "templates/webpages/${template}." . $options->{type}; + my $ext = $options->{type} eq 'text' ? 'txt' : $options->{type}; + $source = "templates/webpages/${template}.${ext}"; croak "Template file ${source} not found" unless -f $source; } elsif (ref($template) eq 'SCALAR') { @@ -223,9 +225,10 @@ The following options are available: =item C -The template type. Can be C (the default), C for JavaScript -or C for JSON content. Affects only the extension that's added -to the file name given with a non-reference C<$template> argument. +The template type. Can be C (the default), C for JavaScript, +C for JSON and C for plain text content. Affects only the +extension that's added to the file name given with a non-reference +C<$template> argument. =item C