X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FHelper%2FPrintOptions.pm;h=cf4616f62554865fe846e3f3be207755d1e11b49;hb=dac355365ac502d9a70d7180a7c23f6dfc7d2e32;hp=2d842afc0d1c63bfb59ebb5a1bb9ad724dcdb171;hpb=3af7680219b879d23022b5ab8fed353fc36b1c91;p=kivitendo-erp.git diff --git a/SL/Helper/PrintOptions.pm b/SL/Helper/PrintOptions.pm index 2d842afc0..cf4616f62 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 @@ -51,6 +55,7 @@ sub get_print_options { ($form->{type} eq 'sales_order') ? ( opthash("sales_order", $form->{PD}{sales_order}, $locale->text('Confirmation')), opthash("proforma", $form->{PD}{proforma}, $locale->text('Proforma Invoice')), + opthash("ic_supply", $form->{PD}{ic_supply}, $locale->text('Intra-Community supply')), ) : undef, ($form->{type} =~ /sales_quotation$/) ? opthash('sales_quotation', $form->{PD}{sales_quotation}, $locale->text('Quotation')) : undef, @@ -59,6 +64,7 @@ sub get_print_options { ($form->{type} eq 'invoice') ? ( opthash("invoice", $form->{PD}{invoice}, $locale->text('Invoice')), opthash("proforma", $form->{PD}{proforma}, $locale->text('Proforma Invoice')), + opthash("invoice_copy", $form->{PD}{invoice_copy}, $locale->text('Invoice Copy')), ) : undef, ($form->{type} eq 'invoice' && $form->{storno}) ? ( opthash("storno_invoice", $form->{PD}{storno_invoice}, $locale->text('Storno Invoice')), @@ -66,6 +72,9 @@ sub get_print_options { ($form->{type} =~ /_delivery_order$/) ? ( opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Delivery Order')), opthash('pick_list', $form->{PD}{pick_list}, $locale->text('Pick List')), + ) : undef, + ($form->{type} =~ /^letter$/) ? ( + opthash('letter', $form->{PD}{letter}, $locale->text('Letter')), ) : undef; push @SENDMODE, @@ -121,7 +130,6 @@ sub get_print_options { my %dont_display_groupitems = ( 'dunning' => 1, - 'letter' => 1, ); my %template_vars = ( @@ -130,7 +138,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" : '' );