summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-19 01:50:19 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-19 01:50:19 +0000
commit6247324f8e4d9f9d141cf4a814c1d75540bd49fb (patch)
tree4b33fe53b915edefd5ef6c8d214c5fa3e53d6df8 /bin
parent36560b22c2b2cf9f56cb25256278932293b0a242 (diff)
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
Diffstat (limited to 'bin')
-rw-r--r--bin/gl.pl22
1 files changed, 21 insertions, 1 deletions
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|<input name="l_description" class=checkbox type=checkbox value=Y checked> |
}
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 {