Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ce06f684

Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt

  • ID ce06f68492a003aa81e3b00fe9fb58618bdb5263
  • Vorgänger a40c356e
  • Nachfolger e26881e3

Auftrags-Controller: DMS: Druck-Variante berücksichtigen

Unterschiede anzeigen:

SL/Controller/Order.pm
330 330
    $self->js->flash('info', t8('The document has been printed.'));
331 331
  }
332 332

  
333
  my @warnings = $self->store_doc_to_webdav_and_filemanagement($doc, $doc_filename);
333
  my @warnings = $self->store_doc_to_webdav_and_filemanagement($doc, $doc_filename, $formname);
334 334
  if (scalar @warnings) {
335 335
    $self->js->flash('warning', $_) for @warnings;
336 336
  }
......
479 479
  # Is an old file version available?
480 480
  my $attfile;
481 481
  if ($::form->{attachment_policy} eq 'old_file') {
482
    $attfile = SL::File->get_all(object_id   => $self->order->id,
483
                                 object_type => $::form->{formname},
484
                                 file_type   => 'document');
482
    $attfile = SL::File->get_all(object_id     => $self->order->id,
483
                                 object_type   => $self->type,
484
                                 file_type     => 'document',
485
                                 print_variant => $::form->{formname});
485 486
  }
486 487

  
487 488
  if ($::form->{attachment_policy} ne 'no_file' && !($::form->{attachment_policy} eq 'old_file' && $attfile)) {
......
496 497
      return $self->js->flash('error', t8('Generating the document failed: #1', $errors[0]))->render($self);
497 498
    }
498 499

  
499
    my @warnings = $self->store_doc_to_webdav_and_filemanagement($doc, $::form->{attachment_filename});
500
    my @warnings = $self->store_doc_to_webdav_and_filemanagement($doc, $::form->{attachment_filename}, $::form->{formname});
500 501
    if (scalar @warnings) {
501 502
      flash_later('warning', $_) for @warnings;
502 503
    }
......
2325 2326
}
2326 2327

  
2327 2328
sub store_doc_to_webdav_and_filemanagement {
2328
  my ($self, $content, $filename) = @_;
2329
  my ($self, $content, $filename, $variant) = @_;
2329 2330

  
2330 2331
  my $order = $self->order;
2331 2332
  my @errors;
......
2355 2356
                     source        => 'created',
2356 2357
                     file_type     => 'document',
2357 2358
                     file_name     => $filename,
2358
                     file_contents => $content);
2359
                     file_contents => $content,
2360
                     print_variant => $variant);
2359 2361
      1;
2360 2362
    } or do {
2361 2363
      push @errors, t8('Storing the document in the storage backend failed: #1', $@);

Auch abrufbar als: Unified diff