Revision 40e0911a
Von Moritz Bunkus vor etwa 7 Jahren hinzugefügt
bin/mozilla/reportgenerator.pl | ||
---|---|---|
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
|
37 |
sub report_generator_setup_action_bar { |
|
38 |
my ($type, %params) = @_; |
|
39 |
|
|
40 |
$::request->layout->get('actionbar')->add( |
|
41 |
combobox => [ |
|
42 |
action => [ |
|
43 |
$type eq 'pdf' ? $::locale->text('PDF export') : $::locale->text('CSV export'), |
|
44 |
submit => [ '#report_generator_form', { 'report_generator_dispatch_to' => "report_generator_export_as_${type}" } ], |
|
45 |
], |
|
46 |
action => [ |
|
47 |
$::locale->text('PDF export with attachments'), |
|
48 |
submit => [ '#report_generator_form', { report_generator_dispatch_to => "report_generator_export_as_pdf", report_generator_addattachments => 1 } ], |
|
49 |
only_if => $params{allow_attachments}, |
|
50 |
], |
|
51 |
], |
|
52 |
action => [ |
|
53 |
$::locale->text('Back'), |
|
54 |
submit => [ '#report_generator_form', { 'report_generator_dispatch_to' => "report_generator_back" } ], |
|
55 |
], |
|
56 |
); |
|
57 |
} |
|
58 |
|
|
37 | 59 |
sub report_generator_export_as_pdf { |
38 | 60 |
$main::lxdebug->enter_sub(); |
39 | 61 |
|
... | ... | |
64 | 86 |
$form->{copies} = max $myconfig{copies} * 1, 1; |
65 | 87 |
|
66 | 88 |
my $allow_font_selection = 1; |
67 |
my $allow_attachments = 0; |
|
68 | 89 |
eval { require PDF::API2; }; |
69 | 90 |
$allow_font_selection = 0 if ($@); |
70 |
$allow_attachments = 1 if $form->{report_generator_hidden_l_attachments}; |
|
71 | 91 |
|
72 | 92 |
$form->{title} = $locale->text('PDF export -- options'); |
93 |
|
|
94 |
report_generator_setup_action_bar('pdf', allow_attachments => !!$form->{report_generator_hidden_l_attachments}); |
|
95 |
|
|
73 | 96 |
$form->header(); |
74 | 97 |
print $form->parse_html_template('report_generator/pdf_export_options', { 'HIDDEN' => \@form_values, |
75 |
'ALLOW_ATTACHMENTS' => $allow_attachments, |
|
76 | 98 |
'ALLOW_FONT_SELECTION' => $allow_font_selection, }); |
77 | 99 |
|
78 | 100 |
$main::lxdebug->leave_sub(); |
... | ... | |
93 | 115 |
my @form_values = $form->flatten_variables(grep { ($_ ne 'login') && ($_ ne 'password') } keys %{ $form }); |
94 | 116 |
|
95 | 117 |
$form->{title} = $locale->text('CSV export -- options'); |
118 |
|
|
119 |
report_generator_setup_action_bar('csv'); |
|
120 |
|
|
96 | 121 |
$form->header(); |
97 | 122 |
print $form->parse_html_template('report_generator/csv_export_options', { 'HIDDEN' => \@form_values }); |
98 | 123 |
|
Auch abrufbar als: Unified diff
ActionBar: Unterstützung in ReportGenerator