1404 |
1404 |
sub print_options {
|
1405 |
1405 |
$lxdebug->enter_sub();
|
1406 |
1406 |
|
1407 |
|
my ($options) = @_;
|
1408 |
|
|
1409 |
|
$options ||= { };
|
|
1407 |
my %options = @_;
|
1410 |
1408 |
|
1411 |
1409 |
# names 3 parameters and returns a hashref, for use in templates
|
1412 |
1410 |
sub opthash { +{ value => shift, selected => shift, oname => shift } }
|
... | ... | |
1461 |
1459 |
opthash("screen", $form->{OP}{screen}, $locale->text('Screen')),
|
1462 |
1460 |
(scalar @{ $form->{printers} } && $latex_templates) ?
|
1463 |
1461 |
opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef,
|
1464 |
|
($latex_templates && !$options->{no_queue}) ?
|
|
1462 |
($latex_templates && !$options{no_queue}) ?
|
1465 |
1463 |
opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef
|
1466 |
1464 |
if ($form->{media} ne 'email');
|
1467 |
1465 |
|
1468 |
1466 |
push @FORMAT, grep $_,
|
1469 |
1467 |
($opendocument_templates && $openofficeorg_writer_bin && $xvfb_bin && (-x $openofficeorg_writer_bin) && (-x $xvfb_bin)
|
1470 |
|
&& !$options->{no_opendocument_pdf}) ?
|
|
1468 |
&& !$options{no_opendocument_pdf}) ?
|
1471 |
1469 |
opthash("opendocument_pdf", $form->{DF}{"opendocument_pdf"}, $locale->text("PDF (OpenDocument/OASIS)")) : undef,
|
1472 |
1470 |
($latex_templates) ?
|
1473 |
1471 |
opthash("pdf", $form->{DF}{pdf}, $locale->text('PDF')) : undef,
|
1474 |
|
($latex_templates && !$options->{no_postscript}) ?
|
|
1472 |
($latex_templates && !$options{no_postscript}) ?
|
1475 |
1473 |
opthash("postscript", $form->{DF}{postscript}, $locale->text('Postscript')) : undef,
|
1476 |
|
(!$options->{no_html}) ?
|
|
1474 |
(!$options{no_html}) ?
|
1477 |
1475 |
opthash("html", $form->{DF}{html}, "HTML") : undef,
|
1478 |
|
($opendocument_templates && !$options->{no_opendocument}) ?
|
|
1476 |
($opendocument_templates && !$options{no_opendocument}) ?
|
1479 |
1477 |
opthash("opendocument", $form->{DF}{opendocument}, $locale->text("OpenDocument/OASIS")) : undef;
|
1480 |
1478 |
|
1481 |
1479 |
push @LANGUAGE_ID,
|
... | ... | |
1486 |
1484 |
map { opthash($_->{id}, ($_->{id} eq $form->{printer_id} ? 'selected' : ''), $_->{printer_description}) } +{}, @{ $form->{printers} }
|
1487 |
1485 |
if ((ref $form->{printers} eq 'ARRAY') && scalar @{ $form->{printers } });
|
1488 |
1486 |
|
1489 |
|
@SELECTS = map { sname => lc $_, DATA => \@$_, show => scalar @$_ }, qw(FORMNAME LANGUAGE_ID FORMAT SENDMODE MEDIA PRINTER_ID);
|
|
1487 |
@SELECTS = map { sname => lc $_, DATA => \@$_, show => !$options{"hide_" . lc($_)} && scalar @$_ }, qw(FORMNAME LANGUAGE_ID FORMAT SENDMODE MEDIA PRINTER_ID);
|
1490 |
1488 |
|
1491 |
1489 |
my %dont_display_groupitems = (
|
1492 |
1490 |
'dunning' => 1,
|
... | ... | |
1502 |
1500 |
|
1503 |
1501 |
my $print_options = $form->parse_html_template("generic/print_options", { SELECTS => \@SELECTS, %template_vars } );
|
1504 |
1502 |
|
1505 |
|
if ($options->{inline}) {
|
|
1503 |
if ($options{inline}) {
|
1506 |
1504 |
$lxdebug->leave_sub() and return $print_options;
|
1507 |
1505 |
} else {
|
1508 |
1506 |
print $print_options; $lxdebug->leave_sub();
|
Die Argumente für print_options() als Hash und nicht als Hash-Referenz übergeben. Weitere Optionen zum Verstecken bestimmter Drop-Down-Boxen eingebaut.