From 323ed79bf81fa5e9bba4c1b14cb2c48ffeda614e Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 26 Apr 2007 20:57:40 +0000 Subject: Adding localization support to templates (for UI) and porting over to parameterized arguments git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1106 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/arapprn.pl | 8 ++++++-- bin/cp.pl | 4 +++- bin/io.pl | 3 ++- bin/pos.pl | 3 ++- bin/rp.pl | 11 +++++++---- 5 files changed, 20 insertions(+), 9 deletions(-) (limited to 'bin') diff --git a/bin/arapprn.pl b/bin/arapprn.pl index 223518d0..0d256c28 100644 --- a/bin/arapprn.pl +++ b/bin/arapprn.pl @@ -288,7 +288,9 @@ sub print_check { if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, 'HTML' ); + LedgerSMB::Template->new( + user => \%myconfig, template => $form->{'formname'}, + format => 'HTML' ); try { $template->render($form); $form->header; @@ -561,7 +563,9 @@ sub print_transaction { if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, 'HTML' ); + LedgerSMB::Template->new( + user => \%myconfig, template => $form->{'formname'}, + format => 'HTML' ); try { $template->render($form); $form->header; diff --git a/bin/cp.pl b/bin/cp.pl index 6a9fc309..d21fa18b 100644 --- a/bin/cp.pl +++ b/bin/cp.pl @@ -49,6 +49,7 @@ use LedgerSMB::CP; use LedgerSMB::OP; use LedgerSMB::IS; use LedgerSMB::IR; +use LedgerSMB::Template; require "bin/arap.pl"; @@ -1475,7 +1476,8 @@ sub print_form { if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, 'HTML' ); + LedgerSMB::Template->new( user => \%myconfig, + template => $form->{'formname'}, format => 'HTML' ); try { $template->render($form); $form->header; diff --git a/bin/io.pl b/bin/io.pl index 4c41462d..d1a00af9 100644 --- a/bin/io.pl +++ b/bin/io.pl @@ -1770,7 +1770,8 @@ sub print_form { if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, 'HTML' ); + LedgerSMB::Template->new( user => \%myconfig, + template => $form->{'formname'}, format => 'HTML' ); try { $template->render($form); $form->header; diff --git a/bin/pos.pl b/bin/pos.pl index f4192cb6..8cc8d73c 100644 --- a/bin/pos.pl +++ b/bin/pos.pl @@ -1010,7 +1010,8 @@ sub print_form { if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, 'HTML' ); + LedgerSMB::Template->new(user => \%myconfig, + template => $form->{'formname'}, format => 'HTML' ); try { $template->render($form); $form->header; diff --git a/bin/rp.pl b/bin/rp.pl index a962ada1..a5c906d3 100644 --- a/bin/rp.pl +++ b/bin/rp.pl @@ -1083,7 +1083,8 @@ sub generate_income_statement { if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, 'HTML' ); + LedgerSMB::Template->new( user => \%myconfig, + template => $form->{'formname'}, format => 'HTML' ); try { $template->render($form); $form->header; @@ -1139,7 +1140,8 @@ sub generate_balance_sheet { if ( ( $form->{'media'} eq 'screen' ) and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, 'HTML' ); + LedgerSMB::Template->new( user => \%myconfig, + template => $form->{'formname'}, format => 'HTML' ); try { $template->render($form); $form->header; @@ -2293,8 +2295,9 @@ sub print_form { and ( $form->{'format'} eq 'html' ) ) { my $template = - LedgerSMB::Template->new( \%myconfig, $form->{'formname'}, - 'HTML' ); + LedgerSMB::Template->new( user => \%myconfig, + template => $form->{'formname'}, + format => 'HTML' ); try { $template->render($form); $form->header; -- cgit v1.2.3