summaryrefslogtreecommitdiff
path: root/bin/cp.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/cp.pl')
-rw-r--r--bin/cp.pl27
1 files changed, 10 insertions, 17 deletions
diff --git a/bin/cp.pl b/bin/cp.pl
index d21fa18b..d9316fea 100644
--- a/bin/cp.pl
+++ b/bin/cp.pl
@@ -1473,23 +1473,16 @@ sub print_form {
$form->{printmode} = '|-';
}
- if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) )
- {
- my $template =
- LedgerSMB::Template->new( user => \%myconfig,
- template => $form->{'formname'}, format => 'HTML' );
- try {
- $template->render($form);
- $form->header;
- print $template->{'output'};
- exit;
- }
- catch Error::Simple with {
- my $E = shift;
- $form->error( $E->stacktrace );
- };
- }
- $form->parse_template( \%myconfig, ${LedgerSMB::Sysconfig::userspath} );
+ my $template = LedgerSMB::Template->new( user => \%myconfig,
+ template => $form->{'formname'}, format => uc $form->{format} );
+ try {
+ $template->render($form);
+ $template->output($form->{media});
+ }
+ catch Error::Simple with {
+ my $E = shift;
+ $form->error( $E->stacktrace );
+ };
}