From 602a4d98939e03b3533f5b6de426ee7f719cf2e1 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 12 Aug 2008 12:42:52 +0000 Subject: [PATCH] =?utf8?q?Auslagern=20von=20Hersteller/Modell-Zeilen=20in?= =?utf8?q?=20eigene=20Templates.=20Hersteller/Modell=20auch=20wieder=20f?= =?utf8?q?=C3=BCr=20Waren=20aktiviert,=20nicht=20nur=20f=C3=BCr=20Erzeugni?= =?utf8?q?sse.=20Fix=20f=C3=BCr=20Bug=20843.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/ic.pl | 39 +++++---------------- bin/mozilla/invoice_io.pl | 3 +- templates/webpages/ic/makemodel_de.html | 19 ++++++++++ templates/webpages/ic/makemodel_master.html | 19 ++++++++++ 4 files changed, 48 insertions(+), 32 deletions(-) create mode 100644 templates/webpages/ic/makemodel_de.html create mode 100644 templates/webpages/ic/makemodel_master.html diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index eb31718b9..93758ec8f 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1523,11 +1523,12 @@ sub form_footer { . $locale->text('Update') . qq|"> |; - unless ($form->{item} eq "service") { - print qq| - {makemodel_rows}> - |; - } +####### moved into makemodel_row ############# +# unless ($form->{item} eq "service") { +# print qq| +# {makemodel_rows}> +# |; +# } print qq| {price_rows}>|; @@ -1594,32 +1595,8 @@ sub makemodel_row { $lxdebug->enter_sub(); my ($numrows) = @_; - print qq| - - - - - - - -|; - - for my $i (1 .. $numrows) { - $form->{"make_$i"} =~ s/\"/"/g; - $form->{"model_$i"} =~ s/\"/"/g; - print qq| - - - - -|; - } - - print qq| -
| . $locale->text('Make') . qq|| . $locale->text('Model') . qq|
- - -|; + my @mm_data = grep { $_->{make} ne '' || $_->{model} ne '' } map +{ make => $form->{"make_$_"}, model => $form->{"model_$_"} }, 1 .. $numrows; + print $form->parse_html_template('ic/makemodel', { MM_DATA => [ @mm_data, {} ], mm_rows => scalar @mm_data + 1 }); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/invoice_io.pl b/bin/mozilla/invoice_io.pl index 2f0f8be50..011c872c8 100644 --- a/bin/mozilla/invoice_io.pl +++ b/bin/mozilla/invoice_io.pl @@ -661,7 +661,8 @@ sub display_form { &{$subroutine}($numrows); - $numrows = 0; + $numrows = ++$form->{makemodel_rows}; + $subroutine = "makemodel_row"; } if ($form->{item} eq 'assembly') { $numrows = $form->{price_rows}; diff --git a/templates/webpages/ic/makemodel_de.html b/templates/webpages/ic/makemodel_de.html new file mode 100644 index 000000000..f90fba5ce --- /dev/null +++ b/templates/webpages/ic/makemodel_de.html @@ -0,0 +1,19 @@ +[%- USE HTML %] +[%- USE LxERP %] + + + + + + + + [%- FOREACH row = MM_DATA %] + + + + + [%- END %] +
HerstellerModell
+ + + diff --git a/templates/webpages/ic/makemodel_master.html b/templates/webpages/ic/makemodel_master.html new file mode 100644 index 000000000..356143d8d --- /dev/null +++ b/templates/webpages/ic/makemodel_master.html @@ -0,0 +1,19 @@ +[%- USE HTML %] +[%- USE LxERP %] + + + + + + + + [%- FOREACH row = MM_DATA %] + + + + + [%- END %] +
MakeModel
+ + + -- 2.20.1