]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Form.pm
SL::MoreCommon: benutztes Encode auch usen
[mfinanz.git] / SL / Form.pm
index 0d6e9ae9afcaead8515c7dcd041733f376ed7c80..9f0cf11bc3385cfbeaac74b3070906fa6b111883 100644 (file)
@@ -40,6 +40,7 @@ package Form;
 use Carp;
 use Data::Dumper;
 
+use Carp;
 use CGI;
 use Cwd;
 use Encode;
@@ -307,8 +308,7 @@ sub error {
     $self->show_generic_error($msg);
 
   } else {
-    print STDERR "Error: $msg\n";
-    ::end_of_request();
+    confess "Error: $msg\n";
   }
 
   $main::lxdebug->leave_sub();
@@ -594,8 +594,11 @@ sub _prepare_html_template {
   if (-f "templates/webpages/${file}.html") {
     $file = "templates/webpages/${file}.html";
 
+  } elsif (ref $file eq 'SCALAR') {
+    # file is a scalarref, use inline mode
   } else {
     my $info = "Web page template '${file}' not found.\n";
+    $::form->header;
     print qq|<pre>$info</pre>|;
     ::end_of_request();
   }
@@ -1019,7 +1022,8 @@ sub parse_template {
                                       file_name => $self->{IN},
                                       form      => $self,
                                       myconfig  => $myconfig,
-                                      userspath => $userspath);
+                                      userspath => $userspath,
+                                      %{ $self->{TEMPLATE_DRIVER_OPTIONS} || {} });
 
   # Copy the notes from the invoice/sales order etc. back to the variable "notes" because that is where most templates expect it to be.
   $self->{"notes"} = $self->{ $self->{"formname"} . "notes" };