From 83cc6a5b947fae258c943b16cfdbdad72f4c690a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 31 Oct 2007 17:18:14 +0000 Subject: [PATCH] Umstellung einiger Vorlagen aus templates/webpages/generic von HTML::Template auf Template. Die Vorlagen calculate_alu* werden gar nicht benutzt und deswegen entfernt. --- SL/Form.pm | 24 ++- bin/mozilla/common.pl | 6 +- bin/mozilla/io.pl | 19 +- .../webpages/generic/calculate_alu_de.html | 162 ------------------ .../generic/calculate_alu_master.html | 162 ------------------ .../webpages/generic/calculate_qty_de.html | 32 ++-- .../generic/calculate_qty_master.html | 32 ++-- templates/webpages/generic/edit_email_de.html | 27 +-- .../webpages/generic/edit_email_master.html | 27 +-- templates/webpages/generic/error_de.html | 10 +- templates/webpages/generic/error_master.html | 10 +- .../webpages/generic/information_de.html | 10 +- .../webpages/generic/information_master.html | 10 +- 13 files changed, 104 insertions(+), 427 deletions(-) delete mode 100644 templates/webpages/generic/calculate_alu_de.html delete mode 100644 templates/webpages/generic/calculate_alu_master.html diff --git a/SL/Form.pm b/SL/Form.pm index a926b3cdd..0445a2546 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -611,9 +611,10 @@ sub parse_html_template2 { sub show_generic_error { my ($self, $error, $title, $action) = @_; - my $add_params = {}; - $add_params->{"title"} = $title if ($title); - $self->{"label_error"} = $error; + my $add_params = { + 'title_error' => $title, + 'label_error' => $error, + }; my @vars; if ($action) { @@ -626,21 +627,26 @@ sub show_generic_error { } $add_params->{"VARIABLES"} = \@vars; + $self->{title} = $title if ($title); + $self->header(); - print($self->parse_html_template("generic/error", $add_params)); + print $self->parse_html_template2("generic/error", $add_params); die("Error: $error\n"); } sub show_generic_information { - my ($self, $error, $title) = @_; + my ($self, $text, $title) = @_; + + my $add_params = { + 'title_information' => $title, + 'label_information' => $text, + }; - my $add_params = {}; - $add_params->{"title"} = $title if ($title); - $self->{"label_information"} = $error; + $self->{title} = $title if ($title); $self->header(); - print($self->parse_html_template("generic/information", $add_params)); + print $self->parse_html_template2("generic/information", $add_params); die("Information: $error\n"); } diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index e9a824178..dee0e0102 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -395,9 +395,9 @@ sub calculate_qty { $form->{formel} = $formel; $form->{"title"} = $locale->text("Please enter values"); $form->header(); - print($form->parse_html_template("generic/calculate_qty", { "HEADER" => \@header, - "VARIABLES" => \@variable, - "onload" => $onload })); + print($form->parse_html_template2("generic/calculate_qty", { "HEADER" => \@header, + "VARIABLES" => \@variable, + "onload" => $onload })); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index a24c0e232..ca505878e 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -676,6 +676,7 @@ sub request_for_quotation { sub edit_e_mail { $lxdebug->enter_sub(); + if ($form->{second_run}) { $form->{print_and_post} = 0; $form->{resubmit} = 0; @@ -699,16 +700,16 @@ sub edit_e_mail { $form->header; my (@dont_hide_key_list, %dont_hide_key, @hidden_keys); - @dont_hide_key_list = qw(action email cc bcc subject message formname sendmode format header override); + @dont_hide_key_list = qw(action email cc bcc subject message sendmode format header override); @dont_hide_key{@dont_hide_key_list} = (1) x @dont_hide_key_list; - @hidden_keys = grep { !$dont_hide_key{$_} } grep { !ref $form->{$_} } keys %$form; - - print $form->parse_html_template('generic/edit_email', - { title => $title, - a_filename => $attachment_filename, - _print_options_ => print_options('inline' => 1), - HIDDEN => [ map +{ name => $_, value => $form->{$_} }, @hidden_keys ], - SHOW_BCC => $myconfig{role} eq 'admin' }); + @hidden_keys = sort grep { !$dont_hide_key{$_} } grep { !ref $form->{$_} } keys %$form; + + print $form->parse_html_template2('generic/edit_email', + { title => $title, + a_filename => $attachment_filename, + _print_options_ => print_options('inline' => 1), + HIDDEN => [ map +{ name => $_, value => $form->{$_} }, @hidden_keys ], + SHOW_BCC => $myconfig{role} eq 'admin' }); $lxdebug->leave_sub(); } diff --git a/templates/webpages/generic/calculate_alu_de.html b/templates/webpages/generic/calculate_alu_de.html deleted file mode 100644 index 5a0761089..000000000 --- a/templates/webpages/generic/calculate_alu_de.html +++ /dev/null @@ -1,162 +0,0 @@ -onload=""> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Menge und Preise unten eingeben
- - - - - - - - - - - - - -
Gesamtlänge des ArtikelsGewicht pro Meter
- -
Preis Alu:
Preis Eloxal:

Menge Alu:
Menge Artikel:

Gesamtpreis:
Gesamtpreis Alu:
Gesamtpreis Eloxal:
- - -
- - - - - diff --git a/templates/webpages/generic/calculate_alu_master.html b/templates/webpages/generic/calculate_alu_master.html deleted file mode 100644 index c6de13cde..000000000 --- a/templates/webpages/generic/calculate_alu_master.html +++ /dev/null @@ -1,162 +0,0 @@ -onload=""> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Insert quantity and prices below.
- - - - - - - - - - - - - -
Total lengthWeight/m
- -
Price Alu:
Price Eloxal:

Quantity Alu:
Quantity Article:

Total:
Total Alu:
Total Eloxal:
- - -
- - - - - diff --git a/templates/webpages/generic/calculate_qty_de.html b/templates/webpages/generic/calculate_qty_de.html index c87570efd..068f1cb5d 100644 --- a/templates/webpages/generic/calculate_qty_de.html +++ b/templates/webpages/generic/calculate_qty_de.html @@ -1,13 +1,13 @@ -onload=""> +[% USE HTML %]
- - + + - + @@ -18,17 +18,17 @@
[% title %]
- - - + [% FOREACH col = HEADER %] + + [% END %] - - - - + [% FOREACH row = VARIABLES %] + + + - + [% END %]
[% col.column_title %]
:
[% HTML.escape(row.description) %]:[% HTML.escape(row.unit) %]
@@ -40,10 +40,10 @@