From: Bernd Bleßmann Date: Wed, 2 Oct 2019 10:08:34 +0000 (+0200) Subject: Auftrags-Controller: self an _row-Template übergeben … X-Git-Tag: release-3.5.6.1~472 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=89689ddb143eb4b8806a6f1b1d074beb6fa1fcde;p=kivitendo-erp.git Auftrags-Controller: self an _row-Template übergeben … … und nicht einzelne Variablen aus self, die dort abgefragt werden. --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 00efeca76..771b1606d 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -791,12 +791,9 @@ sub action_add_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, - TYPE => $self->type, - ALL_PRICE_FACTORS => $self->all_price_factors, - SEARCH_CVPARTNUMBER => $self->search_cvpartnumber, - SHOW_UPDATE_BUTTON => $self->show_update_button, + ITEM => $item, + ID => $item_id, + SELF => $self, ); $self->js @@ -820,12 +817,9 @@ sub action_add_item { $self->get_item_cvpartnumber($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, - TYPE => $self->type, - ALL_PRICE_FACTORS => $self->all_price_factors, - SEARCH_CVPARTNUMBER => $self->search_cvpartnumber, - SHOW_UPDATE_BUTTON => $self->show_update_button, + ITEM => $item, + ID => $item_id, + SELF => $self, ); $self->js ->append('#row_table_id', $row_as_html); @@ -904,12 +898,9 @@ sub action_add_multi_items { $self->get_item_cvpartnumber($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, - TYPE => $self->type, - ALL_PRICE_FACTORS => $self->all_price_factors, - SEARCH_CVPARTNUMBER => $self->search_cvpartnumber, - SHOW_UPDATE_BUTTON => $self->show_update_button, + ITEM => $item, + ID => $item_id, + SELF => $self, ); $self->js->append('#row_table_id', $row_as_html); diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index 42a7a7796..cff019a7c 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -32,7 +32,7 @@ LxERP.t8("X"), confirm=LxERP.t8("Are you sure?")) %] - [%- IF SHOW_UPDATE_BUTTON -%] + [%- IF SELF.show_update_button -%] [%- L.img_tag(src="image/rotate_cw.svg", alt=LxERP.t8('Update from master data'), @@ -44,7 +44,7 @@
[% HTML.escape(ITEM.part.partnumber) %]
- [%- IF SEARCH_CVPARTNUMBER -%] + [%- IF SELF.search_cvpartnumber -%]
[% HTML.escape(ITEM.cvpartnumber) %]
@@ -62,7 +62,7 @@ [%- END -%] [%- L.button_tag("kivi.Order.show_longdescription_dialog(this)", LxERP.t8("L")) %] - [%- IF (TYPE == "sales_order" || TYPE == "purchase_order") -%] + [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%] [%- L.div_tag(LxERP.format_amount(ITEM.shipped_qty, 2, 0) _ ' ' _ ITEM.unit, name="shipped_qty", class="numeric") %] @@ -79,7 +79,7 @@ [%- L.select_tag("order.orderitems[].price_factor_id", - ALL_PRICE_FACTORS, + SELF.all_price_factors, default = ITEM.price_factor_id, title_key = 'description', with_empty = 1, @@ -142,7 +142,7 @@ [%- IF MYCONFIG.show_form_details || ITEM.render_second_row %]
- [%- PROCESS order/tabs/_second_row.html ITEM=ITEM TYPE=TYPE %] + [%- PROCESS order/tabs/_second_row.html ITEM=ITEM TYPE=SELF.type %]
[%- ELSE %]
diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index c040f11ce..698ef6380 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -242,14 +242,7 @@ [%- FOREACH item = SELF.order.items_sorted %] - [%- PROCESS order/tabs/_row.html - ITEM=item - ID=(item.id||item.new_fake_id) - TYPE=SELF.type - ALL_PRICE_FACTORS=SELF.all_price_factors - SEARCH_CVPARTNUMBER=SELF.search_cvpartnumber - SHOW_UPDATE_BUTTON=SELF.show_update_button - -%] + [%- PROCESS order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id) -%] [%- END %]