From 7b6bd910c6cd21341c5e2fd8cf72dd42c1b903e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 10 Sep 2015 23:35:17 +0200 Subject: [PATCH] Auftrags-Controller: zweite Zeile zeigen CVars. --- SL/Controller/Order.pm | 6 +++--- templates/webpages/order/tabs/_row.html | 27 +++++++++++++++---------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index fb3078cff..4cd786436 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -152,13 +152,13 @@ sub action_add_item { $new_attr{discount} = $cv_discount if ! $item->discount; $item->assign_attributes(%new_attr); - $item->id(join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000)) if !$item->id; $self->order->add_items($item); $self->_recalc(); - my $row_as_html = $self->p->render('order/tabs/_row', ITEM => $item); + my $item_id = join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000); + my $row_as_html = $self->p->render('order/tabs/_row', ITEM => $item, ID => $item_id); $self->js ->append('#row_table_id', $row_as_html) @@ -169,7 +169,7 @@ sub action_add_item { ->val('#add_item_sellprice_as_number', '') ->val('#add_item_discount_as_percent', '') ->run('row_table_scroll_down') - ->run('row_set_keyboard_events_by_id', $item->id) + ->run('row_set_keyboard_events_by_id', $item_id) ->focus('#add_item_parts_id_name'); $self->_js_redisplay_amounts_and_taxes; diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index 4d5656f23..ca340ebf8 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -7,7 +7,7 @@ - [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ITEM.id) %] + [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %] [% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %] @@ -65,16 +65,21 @@ - - - - - - - - - - + [%- SET n = 0 %] + [%- FOREACH var = ITEM.cvars_by_config %] + [%- NEXT UNLESS (var.config.processed_flags.editable && ITEM.part.cvar_by_name(var.config.name).is_valid) %] + [%- SET n = n + 1 %] + + + [%- IF (n % (MYCONFIG.form_cvars_nr_cols || 3)) == 0 %] + + [%- END %] + [%- END %]
hi1hi2hi3[%- ITEM.description %]
ho1ho2ho3[%- ITEM.longdescription %] + [% var.config.description %] + + [% L.hidden_tag('order.orderitems[].custom_variables[+].config_id', var.config.id) %] + [% INCLUDE 'common/render_cvar_input.html' var_name='order.orderitems[].custom_variables[].unparsed_value' %] +
-- 2.20.1