Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0bf92081

Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt

  • ID 0bf92081282bc1cad1d7cec16e55f13ca584ff11
  • Vorgänger bc40bcab
  • Nachfolger f1906106

Brieffunktion: beim Drucken im WebDAV speichern

Unterschiede anzeigen:

SL/Controller/Letter.pm
4 4
use parent qw(SL::Controller::Base);
5 5

  
6 6
use Carp;
7
use File::Basename;
7 8
use POSIX qw(strftime);
8 9
use SL::Controller::Helper::GetModels;
9 10
use SL::Controller::Helper::ReportGenerator;
......
247 248
      return !$err;
248 249
    }
249 250

  
251
    my $webdav_copy_args   = Form->new('');
252
    %{ $webdav_copy_args } = (
253
      %{ $::form },
254
      tmpdir  => dirname($pdf_file_name),
255
      tmpfile => basename($pdf_file_name),
256
      cwd     => POSIX::getcwd(),
257
    );
258

  
250 259
    if (!$::form->{printer_id} || $::form->{media} eq 'screen') {
251 260

  
252 261
      my $file = IO::File->new($pdf_file_name, 'r') || croak("Cannot open file '$pdf_file_name'");
......
263 272
      $::locale->with_raw_io(\*STDOUT, sub { print while <$file> });
264 273
      $file->close;
265 274

  
266
      Common::copy_file_to_webdav_folder($::form) if $::instance_conf->get_webdav_documents;
275
      Common::copy_file_to_webdav_folder($webdav_copy_args) if $::instance_conf->get_webdav_documents;
267 276
      unlink $pdf_file_name;
268 277
      return 1;
269 278
    }
......
275 284
    binmode $out;
276 285
    print $out scalar(read_file($pdf_file_name));
277 286
    close $out;
278
    Common::copy_file_to_webdav_folder($::form) if $::instance_conf->get_webdav_documents;
287
    Common::copy_file_to_webdav_folder($webdav_copy_args) if $::instance_conf->get_webdav_documents;
279 288

  
280 289
    flash_later('info', t8('The documents have been sent to the printer \'#1\'.', $printer->printer_description));
281 290
    $self->redirect_to(action => 'edit', id => $letter->{id}, 'printer_id' => $::form->{printer_id});

Auch abrufbar als: Unified diff