summaryrefslogtreecommitdiff
path: root/bin/io.pl
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-26 23:57:13 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-26 23:57:13 +0000
commitb9982a0314b74a8fb342a20568a3e15b90d625bc (patch)
tree9cfe46d004c4f776babefe0eb7fbadb7435491bc /bin/io.pl
parent5f4e46ad636f986668a65aeaa7ce7ae314365378 (diff)
Adding PDF and Postscript support to LedgerSMB::Template
Removing all calls to $form->parse_template git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1241 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin/io.pl')
-rw-r--r--bin/io.pl28
1 files changed, 10 insertions, 18 deletions
diff --git a/bin/io.pl b/bin/io.pl
index d1a00af9..6b21c95a 100644
--- a/bin/io.pl
+++ b/bin/io.pl
@@ -1767,24 +1767,16 @@ sub print_form {
$form->{fileid} = $form->{"${inv}number"};
$form->{fileid} =~ s/(\s|\W)+//g;
- 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 );
+ };
# if we got back here restore the previous form
if ( defined %$old_form ) {