Form->prepare_for_printing: template_meta zur Verfügung stellen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 8 Jan 2014 09:05:42 +0000 (10:05 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 8 Jan 2014 09:06:29 +0000 (10:06 +0100)
Behebt #2247.

SL/Form.pm

index e115f97..2e4f5a9 100644 (file)
@@ -3465,6 +3465,16 @@ sub prepare_for_printing {
     $self->reformat_numbers($output_numberformat, $precision, @{ $field_list });
   }
 
+  $self->{template_meta} = {
+    formname  => $self->{formname},
+    language  => SL::DB::Manager::Language->find_by_or_create(id => $self->{language_id} || undef),
+    format    => $self->{format},
+    media     => $self->{media},
+    extension => $extension,
+    printer   => SL::DB::Manager::Printer->find_by_or_create(id => $self->{printer_id} || undef),
+    today     => DateTime->today,
+  };
+
   return $self;
 }