X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/958c1727a1453b28feaf8c4bfa40ef25f8bcc3ea..eeb5375ee7727c956cc357cc8f90b19d1bfe80b9:/SL/Controller/Helper/ReportGenerator.pm diff --git a/SL/Controller/Helper/ReportGenerator.pm b/SL/Controller/Helper/ReportGenerator.pm index be9b8306d..becc19659 100644 --- a/SL/Controller/Helper/ReportGenerator.pm +++ b/SL/Controller/Helper/ReportGenerator.pm @@ -12,7 +12,9 @@ use SL::ReportGenerator; use Exporter 'import'; our @EXPORT = qw( - action_report_generator_export_as_pdf action_report_generator_export_as_csv + action_report_generator_export_as_pdf + action_report_generator_export_as_csv + action_report_generator_export_as_chart action_report_generator_back report_generator_do report_generator_list_objects ); @@ -26,7 +28,7 @@ sub _setup_action_bar { for my $bar ($::request->layout->get('actionbar')) { $bar->add( action => [ - $type eq 'pdf' ? $::locale->text('PDF export') : $::locale->text('CSV export'), + $type eq 'pdf' ? $::locale->text('PDF export') : $type eq 'csv' ? $::locale->text('CSV export') : $::locale->text('Chart export'), submit => [ '#report_generator_form', { $key => "${value}report_generator_export_as_${type}" } ], ], action => [ @@ -92,6 +94,27 @@ sub action_report_generator_export_as_csv { print $::form->parse_html_template('report_generator/csv_export_options', { 'HIDDEN' => \@form_values }); } +sub action_report_generator_export_as_chart { + my ($self) = @_; + + delete $::form->{action_report_generator_export_as_chart}; + + if ($::form->{report_generator_chart_options_set}) { + $self->report_generator_do('Chart'); + return; + } + + my $fields = delete $::form->{report_generator_chart_fields}; + my @form_values = $::form->flatten_variables(grep { ($_ ne 'login') && ($_ ne 'password') } keys %{ $::form }); + + $::form->{title} = $::locale->text('Chart export -- options'); + + _setup_action_bar($self, 'chart'); # Sub not exported, therefore don't call via object. + + $::form->header; + print $::form->parse_html_template('report_generator/chart_export_options', { 'HIDDEN' => \@form_values, fields => $fields }); +} + sub action_report_generator_back { $_[0]->report_generator_do('HTML'); }