X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=9f0cf11bc3385cfbeaac74b3070906fa6b111883;hb=574855561514a864f554776c421e7037196e714d;hp=875b726c151cfcc1697f1b89ed28719a41fedf34;hpb=e42233910a57d39f3ccef150db1212f7ecb7fb30;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 875b726c1..9f0cf11bc 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -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(); @@ -472,7 +472,7 @@ sub header { $layout->use_javascript("$_.js") for (qw( jquery jquery-ui jquery.cookie jquery.checkall jquery.download - jquery/jquery.form client_js + jquery/jquery.form jquery/fixes client_js common part_selection switchmenuframe autocomplete_part ), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}"); @@ -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|
$info
|; ::end_of_request(); } @@ -695,7 +698,6 @@ sub show_generic_error { } if ($::request->is_ajax) { - $::lxdebug->message(0, "trying to render AJAX response..."); SL::ClientJS->new ->error($error) ->render(SL::Controller::Base->new); @@ -1020,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" };