X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Freportgenerator.pl;h=5f5d4079bd27feb58b2e6e60797c34b1426162af;hb=1043d7f814fccf5864e677b1e38577d0a150026c;hp=bdccb3b5a1e095bc4619ee86920e57f93c1445e0;hpb=9aaca43317d3ea33d80a308cab7ce4c20d732a16;p=kivitendo-erp.git diff --git a/bin/mozilla/reportgenerator.pl b/bin/mozilla/reportgenerator.pl index bdccb3b5a..5f5d4079b 100644 --- a/bin/mozilla/reportgenerator.pl +++ b/bin/mozilla/reportgenerator.pl @@ -16,6 +16,20 @@ use SL::Common; use SL::MoreCommon; use SL::ReportGenerator; +sub report_generator_set_default_sort { + $lxdebug->enter_sub(); + + my $default_sortorder = shift; + my $default_sortdir = shift; + + $form->{sort} ||= $default_sortorder; + $form->{sortdir} = $default_sortdir unless (defined $form->{sortdir}); + $form->{sortdir} = $form->{sortdir} ? 1 : 0; + + $lxdebug->leave_sub(); +} + + sub report_generator_export_as_pdf { $lxdebug->enter_sub(); @@ -34,17 +48,21 @@ sub report_generator_export_as_pdf { return; } - my @form_values; - map { push @form_values, { 'key' => $_, 'value' => $form->{$_} } } keys %{ $form }; + my @form_values = $form->flatten_variables(grep { ($_ ne 'login') && ($_ ne 'password') } keys %{ $form }); $form->get_lists('printers' => 'ALL_PRINTERS'); map { $_->{selected} = $myconfig{default_printer_id} == $_->{id} } @{ $form->{ALL_PRINTERS} }; $form->{copies} = max $myconfig{copies} * 1, 1; + my $allow_font_selection = 1; + eval { require PDF::API2; }; + $allow_font_selection = 0 if ($@); + $form->{title} = $locale->text('PDF export -- options'); $form->header(); - print $form->parse_html_template('report_generator/pdf_export_options', { 'HIDDEN' => \@form_values }); + print $form->parse_html_template('report_generator/pdf_export_options', { 'HIDDEN' => \@form_values, + 'ALLOW_FONT_SELECTION' => $allow_font_selection, }); $lxdebug->leave_sub(); } @@ -58,8 +76,7 @@ sub report_generator_export_as_csv { return; } - my @form_values; - map { push @form_values, { 'key' => $_, 'value' => $form->{$_} } } keys %{ $form }; + my @form_values = $form->flatten_variables(grep { ($_ ne 'login') && ($_ ne 'password') } keys %{ $form }); $form->{title} = $locale->text('CSV export -- options'); $form->header();