From: Moritz Bunkus Date: Wed, 15 Feb 2006 08:14:26 +0000 (+0000) Subject: Erlaube die Uebergabe von weiteren Parametern direkt an die HTML-Vorlage unter Umgehu... X-Git-Tag: release-2.4.0^2~337 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=86be28e9b1744d86e2db534c3d2b005eb5f144f5;p=kivitendo-erp.git Erlaube die Uebergabe von weiteren Parametern direkt an die HTML-Vorlage unter Umgehung von $form. --- diff --git a/SL/Form.pm b/SL/Form.pm index db2cb4907..95034e57b 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -424,7 +424,7 @@ function fokus(){document.$self->{fokus}.focus();} sub parse_html_template { $main::lxdebug->enter_sub(); - my ($self, $myconfig, $file) = @_; + my ($self, $myconfig, $file, $additional_params) = @_; if (-f "templates/webpages/${file}_" . $myconfig->{"countrycode"} . ".html") { @@ -442,15 +442,23 @@ sub parse_html_template { "case_sensitive" => 1, "loop_context_vars" => 1, "global_vars" => 1); - my @params = $template->param(); - if (grep("DEBUG", @params) && $self->{"DEBUG"}) { - $template->param("DEBUG" => "
DEBUG INFORMATION:
" .
-                     $self->{"DEBUG"} . "
"); + $additional_params = {} unless ($additional_params); + if ($self->{"DEBUG"}) { + $additional_params->{"DEBUG"} = $self->{"DEBUG"}; } - foreach my $key (keys(%{$self})) { - if (("DEBUG" ne $key) && grep(${key}, @params)) { + if ($additional_params->{"DEBUG"}) { + $additional_params->{"DEBUG"} = + "
DEBUG INFORMATION:
" . $additional_params->{"DEBUG"} . "
"; + } + + my @additional_param_names = keys(%{$additional_params}); + + foreach my $key ($template->param()) { + if (grep(/^${key}$/, @additional_param_names)) { + $template->param($key => $additional_params->{$key}); + } else { $template->param($key => $self->{$key}); } } @@ -465,10 +473,11 @@ sub parse_html_template { sub show_generic_error { my ($self, $myconfig, $error, $title) = @_; - $self->{"title"} = $title if ($title); + my $add_params = {}; + $add_params->{"title"} = $title if ($title); $self->{"label_error"} = $error; - print($self->parse_html_template($myconfig, "generic/error")); + print($self->parse_html_template($myconfig, "generic/error", $add_params)); } # write Trigger JavaScript-Code ($qty = quantity of Triggers)