From a4f92ff17d2572ec3a0465fe4444c741d80ecc77 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 24 May 2007 07:25:32 +0000 Subject: [PATCH] =?utf8?q?Bei=20print=5Foptions()=20die=20Parameter=C3=BCb?= =?utf8?q?ergabe=20umgestellt,=20sodass=20der=20Aufrufer=20das=20Verhalten?= =?utf8?q?=20etwas=20genauer=20beeinflussen=20kann.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/io.pl | 17 +++++++++++++---- .../webpages/generic/print_options_de.html | 2 ++ .../webpages/generic/print_options_master.html | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 7648dc1fd..7f8f65a54 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1283,7 +1283,7 @@ sub edit_e_mail { print $form->parse_html_template('generic/edit_email', { title => $title, a_filename => $attachment_filename, - _print_options_ => print_options('inline'), + _print_options_ => print_options({ 'inline' => 1 }), HIDDEN => [ map +{ name => $_, value => $form->{$_} }, @hidden_keys ], SHOW_BCC => $myconfig{role} eq 'admin' }); @@ -1315,7 +1315,11 @@ sub send_email { # # the inline options is untested, but intended to be used later in metatemplating sub print_options { - $lxdebug->enter_sub() and my ($inline) = @_; + $lxdebug->enter_sub(); + + my ($options) = @_; + + $options ||= { }; # names 3 parameters and returns a hashref, for use in templates sub opthash { +{ value => shift, selected => shift, oname => shift } } @@ -1370,7 +1374,7 @@ sub print_options { opthash("screen", $form->{OP}{screen}, $locale->text('Screen')), (scalar @{ $form->{printers} } && $latex_templates) ? opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef, - ($latex_templates) ? + ($latex_templates && !$options{no_queue}) ? opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef if ($form->{media} ne 'email'); @@ -1395,16 +1399,21 @@ sub print_options { @SELECTS = map { sname => lc $_, DATA => \@$_, show => scalar @$_ }, qw(FORMNAME LANGUAGE_ID FORMAT SENDMODE MEDIA PRINTER_ID); + my %dont_display_groupitems = ( + 'dunning' => 1, + ); + %template_vars = ( display_copies => scalar @{ $form->{printers} } && $latex_templates && $form->{media} ne 'email', display_remove_draft => (!$form->{id} && $form->{draft_id}), + display_groupitems => !$dont_display_groupitems{$form->{type}}, groupitems_checked => $form->{groupitems} ? "checked" : '', remove_draft_checked => $form->{remove_draft} ? "checked" : '' ); my $print_options = $form->parse_html_template("generic/print_options", { SELECTS => \@SELECTS, %template_vars } ); - if ($inline) { + if ($options{inline}) { $lxdebug->leave_sub() and return $print_options; } else { print $print_options; $lxdebug->leave_sub(); diff --git a/templates/webpages/generic/print_options_de.html b/templates/webpages/generic/print_options_de.html index 352450951..1b952b927 100644 --- a/templates/webpages/generic/print_options_de.html +++ b/templates/webpages/generic/print_options_de.html @@ -12,8 +12,10 @@ Kopien > + Waren gruppieren > + Entwurf löschen > diff --git a/templates/webpages/generic/print_options_master.html b/templates/webpages/generic/print_options_master.html index a9fe1eecd..c0a37ea00 100644 --- a/templates/webpages/generic/print_options_master.html +++ b/templates/webpages/generic/print_options_master.html @@ -12,8 +12,10 @@ Copies > + Group Items > + Remove Draft > -- 2.20.1