From 43a1ccc8ea1c5dd209ecc24d7ebc68af7aec7500 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Sat, 30 Aug 2014 01:27:12 +0200 Subject: [PATCH] Benutzerdef. Variablen in Belegen als Tabelle rendern ... falsches Tabellen-Layout bei nicht editierbaren Variablen korrigiert. Zu commit 25b855157fa65535683b458c1ca2dd0c3636b788 Benutzerdef. Variablen in Belegen als Tabelle rendern ... --- bin/mozilla/io.pl | 6 ++++-- templates/webpages/oe/sales_order.html | 14 +++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index f3f194528..4a5a4cd0d 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1879,9 +1879,11 @@ sub _render_custom_variables_inputs { } } + my $hide_non_editable = 1; + my $show = 0; my $description = ''; - if (($cvar->{flag_editable} && $cvar->{valid}) && !$partsgroup_filtered) { + if (( ($cvar->{flag_editable} || !$hide_non_editable) && $cvar->{valid}) && !$partsgroup_filtered) { $num_visible_cvars++; $description = $cvar->{description} . ' '; $show = 1; @@ -1894,7 +1896,7 @@ sub _render_custom_variables_inputs { description => $description, cvar => 1, render_options => { - hide_non_editable => 1, + hide_non_editable => $hide_non_editable, var => $cvar, name_prefix => 'ic_', name_postfix => "_$params{row}", diff --git a/templates/webpages/oe/sales_order.html b/templates/webpages/oe/sales_order.html index f0fecb6f3..f8db6ba82 100644 --- a/templates/webpages/oe/sales_order.html +++ b/templates/webpages/oe/sales_order.html @@ -36,16 +36,20 @@ + + [%# render all row2 entries except cvars %] [%- FOREACH row2 = row.ROW2 %] [%- IF !row2.cvar %] [% row2.value %] [%- END %] [%- END %] + [%# process editable cvars %] [%- FOREACH row2 = row.ROW2 %] - [%- IF row2.cvar && row2.render_options.valid && !row2.render_options.partsgroup_filtered %] + [%- SET show = ((row2.render_options.var.flag_editable || !row2.render_options.hide_non_editable ) && row2.render_options.valid && !row2.render_options.partsgroup_filtered) %] + [%- IF row2.cvar && show %] [%- IF row2.line_break %] [%- END %] @@ -60,6 +64,14 @@
+ [%# process non editable cvars extra to not disturb the table layout (this will be hidden inputs) %] + [%- FOREACH row2 = row.ROW2 %] + [%- SET hide = (!row2.render_options.var.flag_editable && row2.render_options.hide_non_editable) %] + [%- IF row2.cvar && hide %] + [% PROCESS cvar_inputs cvar = row2.render_options %] + [%- END %] + [%- END %] + [%- END %] -- 2.20.1