Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 52352135

Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt

  • ID 52352135ee322387c8eba0fcbbb09dd50abbdf09
  • Vorgänger f290077f
  • Nachfolger f83781c6

Die Argumente für print_options() als Hash und nicht als Hash-Referenz übergeben. Weitere Optionen zum Verstecken bestimmter Drop-Down-Boxen eingebaut.

Unterschiede anzeigen:

bin/mozilla/dn.pl
124 124
  $form->{jsscript}       = 1;
125 125
  $form->{callback}     ||= build_std_url("action=show_invoices", qw(login password customer invnumber ordnumber groupinvoices minamount dunning_level notes));
126 126

  
127
  $form->{PRINT_OPTIONS}  = print_options({ 'inline'          => 1,
128
                                            'no_queue'        => 1,
129
                                            'no_postscript'   => 1,
130
                                            'no_html'         => 1,
131
                                            'no_opendocument' => 1, });
127
  $form->{PRINT_OPTIONS}  = print_options('inline'          => 1,
128
                                          'no_queue'        => 1,
129
                                          'no_postscript'   => 1,
130
                                          'no_html'         => 1,
131
                                          'no_opendocument' => 1,);
132 132

  
133 133
  $form->header();
134 134
  print $form->parse_html_template("dunning/show_invoices");
......
282 282
                   'languages' => 'languages');
283 283

  
284 284
  $form->{type}          = 'dunning';
285
  $form->{PRINT_OPTIONS} = print_options({ 'inline'          => 1,
286
                                           'no_queue'        => 1,
287
                                           'no_postscript'   => 1,
288
                                           'no_html'         => 1,
289
                                           'no_opendocument' => 1, });
285
  $form->{PRINT_OPTIONS} = print_options('inline'          => 1,
286
                                         'no_queue'        => 1,
287
                                         'no_postscript'   => 1,
288
                                         'no_html'         => 1,
289
                                         'no_opendocument' => 1,);
290 290
  $form->{title}         = $locale->text('Dunning overview');
291 291

  
292 292
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
bin/mozilla/io.pl
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();

Auch abrufbar als: Unified diff