X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FHelper%2FPrintOptions.pm;h=553e812b1f410dd6255f2b3a5fdb92f1dae5d348;hb=bae8f672cb7a0c7062b0570d3c91e7f9ac756f1f;hp=7569ea6877b18d7c06d75ce8d62a6894e51c0b54;hpb=762f348476e09df5619fa11d7ec070209cb843f4;p=kivitendo-erp.git diff --git a/SL/Helper/PrintOptions.pm b/SL/Helper/PrintOptions.pm index 7569ea687..553e812b1 100644 --- a/SL/Helper/PrintOptions.pm +++ b/SL/Helper/PrintOptions.pm @@ -4,6 +4,7 @@ use strict; use List::MoreUtils qw(any); +sub opthash { +{ value => shift, selected => shift, oname => shift } } # generate the printing options displayed at the bottom of oe and is forms. # this function will attempt to guess what type of form is displayed, and will generate according options @@ -17,15 +18,18 @@ use List::MoreUtils qw(any); sub get_print_options { my ($class, %params) = @_; + no warnings 'once'; + my $form = $params{form} || $::form; my $myconfig = $params{myconfig} || \%::myconfig; my $locale = $params{locale} || $::locale; my $options = $params{options}; + use warnings 'once'; + my $prefix = $options->{dialog_name_prefix} || ''; # names 3 parameters and returns a hashref, for use in templates - sub opthash { +{ value => shift, selected => shift, oname => shift } } my (@FORMNAME, @LANGUAGE_ID, @FORMAT, @SENDMODE, @MEDIA, @PRINTER_ID, @SELECTS) = (); # note: "||"-selection is only correct for values where "0" is _not_ a correct entry @@ -133,7 +137,9 @@ sub get_print_options { display_copies => scalar @{ $form->{printers} || [] } && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email', display_remove_draft => (!$form->{id} && $form->{draft_id}), display_groupitems => !$dont_display_groupitems{$form->{type}}, + display_bothsided => $options->{show_bothsided}, groupitems_checked => $form->{groupitems} ? "checked" : '', + bothsided_checked => $form->{bothsided} ? "checked" : '', remove_draft_checked => $form->{remove_draft} ? "checked" : '' );