# 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
# 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
my $form = $params{form} || $::form;
my $myconfig = $params{myconfig} || \%::myconfig;
my $locale = $params{locale} || $::locale;
my $options = $params{options};
my $form = $params{form} || $::form;
my $myconfig = $params{myconfig} || \%::myconfig;
my $locale = $params{locale} || $::locale;
my $options = $params{options};
my $prefix = $options->{dialog_name_prefix} || '';
# names 3 parameters and returns a hashref, for use in templates
my $prefix = $options->{dialog_name_prefix} || '';
# names 3 parameters and returns a hashref, for use in templates
my (@FORMNAME, @LANGUAGE_ID, @FORMAT, @SENDMODE, @MEDIA, @PRINTER_ID, @SELECTS) = ();
# note: "||"-selection is only correct for values where "0" is _not_ a correct entry
my (@FORMNAME, @LANGUAGE_ID, @FORMAT, @SENDMODE, @MEDIA, @PRINTER_ID, @SELECTS) = ();
# note: "||"-selection is only correct for values where "0" is _not_ a correct entry
($form->{type} eq 'sales_order') ? (
opthash("sales_order", $form->{PD}{sales_order}, $locale->text('Confirmation')),
opthash("proforma", $form->{PD}{proforma}, $locale->text('Proforma Invoice')),
($form->{type} eq 'sales_order') ? (
opthash("sales_order", $form->{PD}{sales_order}, $locale->text('Confirmation')),
opthash("proforma", $form->{PD}{proforma}, $locale->text('Proforma Invoice')),
) : undef,
($form->{type} =~ /sales_quotation$/) ?
opthash('sales_quotation', $form->{PD}{sales_quotation}, $locale->text('Quotation')) : undef,
) : undef,
($form->{type} =~ /sales_quotation$/) ?
opthash('sales_quotation', $form->{PD}{sales_quotation}, $locale->text('Quotation')) : undef,
($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')),
($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')),
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_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}},