Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a0516348

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID a0516348e76b315f149bd1014ef68eaf24d7073c
  • Vorgänger aa925eed
  • Nachfolger f4958a2b

io.pl print_form: CreatePDF zum Auffinden des Templates nutzen

Unterschiede anzeigen:

bin/mozilla/io.pl
50 50
use SL::DB::Default;
51 51
use SL::DB::Language;
52 52
use SL::DB::Printer;
53
use SL::Helper::CreatePDF;
53 54
use SL::Helper::Flash;
54 55

  
55 56
require "bin/mozilla/common.pl";
......
1505 1506
  }
1506 1507

  
1507 1508
  # search for the template
1508
  my @template_files;
1509
  push @template_files, "$form->{formname}_email$form->{language}$printer_code.$extension" if $form->{media} eq 'email';
1510
  push @template_files, "$form->{formname}$form->{language}$printer_code.$extension";
1511
  push @template_files, "$form->{formname}.$extension";
1512
  push @template_files, "default.$extension";
1513
  @template_files = uniq @template_files;
1514
  $form->{IN}     = first { -f ($defaults->templates . "/$_") } @template_files;
1515

  
1516
  if (!defined $form->{IN}) {
1509
  my ($template_file, @template_files) = SL::Helper::CreatePDF->find_template(
1510
    name        => $form->{formname},
1511
    email       => $form->{media} eq 'email',
1512
    language_id => $form->{language_id},
1513
    printer_id  => $form->{printer_id},
1514
    extension   => $extension,
1515
  );
1516

  
1517
  if (!defined $template_file) {
1517 1518
    $::form->error($::locale->text('Cannot find matching template for this print request. Please contact your template maintainer. I tried these: #1.', join ', ', map { "'$_'"} @template_files));
1518 1519
  }
1519 1520

  
1521
  $form->{IN} = $template_file;
1522

  
1520 1523
  delete $form->{OUT};
1521 1524

  
1522 1525
  if ($form->{media} eq 'printer') {

Auch abrufbar als: Unified diff