Revision faea2c48
Von Jan Büren vor mehr als 9 Jahren hinzugefügt
bin/mozilla/letter.pl | ||
---|---|---|
21 | 21 |
use SL::DB::Default; |
22 | 22 |
use SL::Helper::CreatePDF; |
23 | 23 |
use SL::Helper::Flash; |
24 |
use SL::Common; |
|
25 |
use Cwd; |
|
24 | 26 |
require "bin/mozilla/reportgenerator.pl"; |
25 | 27 |
require "bin/mozilla/io.pl"; |
26 | 28 |
require "bin/mozilla/arap.pl"; |
... | ... | |
376 | 378 |
die( t8('Please create/copy a template named letter.tex in your client template dir') ) unless (-e $tex_templates); |
377 | 379 |
|
378 | 380 |
$pdf_file_name = SL::Helper::CreatePDF->create_pdf(%create_params); |
381 |
|
|
382 |
# set some form defaults for printing webdav copy variables |
|
383 |
$form->{tmpfile} = $pdf_file_name; |
|
384 |
$form->{tmpdir} = 'users'; |
|
385 |
$form->{type} = 'letter'; |
|
386 |
$form->{cwd} = getcwd(); |
|
379 | 387 |
if ( $::form->{media} eq 'email') { |
380 | 388 |
my $mail = Mailer->new; |
381 | 389 |
my $signature = $::myconfig{signature}; |
... | ... | |
387 | 395 |
$mail->{message} .= "\n-- \n$signature"; |
388 | 396 |
$mail->{message} =~ s/\r//g; |
389 | 397 |
|
398 |
# copy_file_to_webdav was already done via io.pl -> edit_e_mail |
|
390 | 399 |
my $err = $mail->send; |
391 |
# TODO |
|
392 |
# $self |
|
393 |
# ->js |
|
394 |
# ->flash($err?'error':'info', |
|
395 |
# $err?t8('A mail error occurred: #1', $err): |
|
396 |
# t8('The document have been sent to \'#1\'.', $mail->{to})) |
|
397 |
# ->render($self); |
|
400 |
# TODO
|
|
401 |
# $self
|
|
402 |
# ->js
|
|
403 |
# ->flash($err?'error':'info',
|
|
404 |
# $err?t8('A mail error occurred: #1', $err):
|
|
405 |
# t8('The document have been sent to \'#1\'.', $mail->{to}))
|
|
406 |
# ->render($self);
|
|
398 | 407 |
return $err?0:1; |
399 | 408 |
} |
400 | 409 |
|
... | ... | |
412 | 421 |
|
413 | 422 |
$::locale->with_raw_io(\*STDOUT, sub { print while <$file> }); |
414 | 423 |
$file->close; |
424 |
Common::copy_file_to_webdav_folder($form) if $::instance_conf->get_webdav_documents; |
|
415 | 425 |
unlink $pdf_file_name; |
416 | 426 |
return 1; |
417 | 427 |
} |
... | ... | |
423 | 433 |
binmode $out; |
424 | 434 |
print $out scalar(read_file($pdf_file_name)); |
425 | 435 |
close $out; |
436 |
Common::copy_file_to_webdav_folder($form) if $::instance_conf->get_webdav_documents; |
|
426 | 437 |
|
427 | 438 |
flash_later('info', t8('The documents have been sent to the printer \'#1\'.', $printer->printer_description)); |
428 | 439 |
my $callback = build_std_url('letter.pl', 'action=edit', 'id=' . $letter->{id}, 'printer_id'); |
... | ... | |
495 | 506 |
$letter->check_number; |
496 | 507 |
$letter->save; |
497 | 508 |
|
509 |
$form->{formname} = "letter"; |
|
498 | 510 |
$letter->export_to($::form); |
499 | 511 |
|
500 | 512 |
$::form->{id} = $letter->{id}; |
Auch abrufbar als: Unified diff
Changelog für 3.2.x Brieffunktion erweitert
Brief: Immer erst speichern, bevor man ausdruckt / mailt
Klare Benutzerführung. Ist notwendig, wenn man die WebDAV-Archivierung
konsistent haben will (da hier letternumber benötigt wird).
Erweiterung Common.pm um Briefarchivierung in WebDAV
Besseres Debbugging in copy_file_to_webdav und neuen
Dokumententyp in get_webdav_folder (welche hässlich ist)
Anpassungen für Brief in io.pl für E-Mail-Versand
... alles so gelassen wie es war, bloss nichts kaputt machen und mit
minimalen fußabdrücken wieder raus aus diesem teil der stadt ...
Erweiterung Brieffunktion um WebDAV-Archivierung