From 6247324f8e4d9f9d141cf4a814c1d75540bd49fb Mon Sep 17 00:00:00 2001 From: tetragon Date: Fri, 19 Oct 2007 01:50:19 +0000 Subject: Add email support to new templating system, ex-parse_template email needs update Add email output to GL report for a simple test (hardcoded addresses) git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1791 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/gl.pl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/gl.pl b/bin/gl.pl index adc7bafe..60de0506 100644 --- a/bin/gl.pl +++ b/bin/gl.pl @@ -431,6 +431,7 @@ qq| | } sub generate_report { + my $output_options = shift; $form->{sort} = "transdate" unless $form->{sort}; $form->{amountfrom} = $form->parse_amount(\%myconfig, $form->{amountfrom}); @@ -788,6 +789,13 @@ sub generate_report { type => 'submit', class => 'submit', }; + push @buttons, { + name => 'action', + value => 'csv_email_gl_report', + text => $locale->text('Email CSV Report'), + type => 'submit', + class => 'submit', + }; ##SC: Taking this out for now... ## if ( $form->{lynx} ) { @@ -807,7 +815,10 @@ sub generate_report { locale => $locale, path => 'UI', template => 'form-dynatable', - format => ($format ne 'CSV')? 'HTML': 'CSV'); + format => ($format ne 'CSV')? 'HTML': 'CSV', + output_options => $output_options, + ); + $template->{method} = 'email' if $output_options; $template->render({ form => \%$form, buttons => \@buttons, @@ -819,10 +830,19 @@ sub generate_report { row_alignment => \%row_alignment, totals => \%column_data, }); + $form->info($locale->text('GL report sent to [_1]', $form->{login})); } sub csv_gl_report { &generate_report } +sub csv_email_gl_report { + ##SC: XXX hardcoded test values + &generate_report({ + to => 'seneca@localhost', + from => 'seneca@localhost', + subject => 'CSV GL report', + }); +} sub gl_subtotal_tt { -- cgit v1.2.3