From f825d995db2667be33e98ced722ddf012b484642 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 3 Aug 2018 15:08:31 +0200 Subject: [PATCH] Auftrags-Controller: nur neue Maske/Links hierhin, wenn experimentelle Features an MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - in Menüs Verkauf/Einkauf: Links zu Angebot u. Auftrag) - in Berichten Angebot/Auftrag und Lieferscheine: Links zu Angeboten und Auträgen - im Presenter (und damit in der Liste der verknüpfte Belege) - Todo-Liste --- SL/Presenter/Order.pm | 16 +++++++++++----- bin/mozilla/do.pl | 4 +++- bin/mozilla/oe.pl | 16 +++++++--------- menus/user/10-order-controller.yaml | 21 +++++++++++++++++---- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/SL/Presenter/Order.pm b/SL/Presenter/Order.pm index 92e666c09..5c381adfd 100644 --- a/SL/Presenter/Order.pm +++ b/SL/Presenter/Order.pm @@ -42,11 +42,17 @@ sub _oe_record { my $number_method = $order->quotation ? 'quonumber' : 'ordnumber'; - my $text = join '', ( - $params{no_link} ? '' : '', - escape($order->$number_method), - $params{no_link} ? '' : '', - ); + my $link_start = ''; + my $link_end = ''; + unless ($params{no_link}) { + my $action = $::instance_conf->get_feature_experimental + ? 'controller.pl?action=Order/edit' + : 'oe.pl?action=edit'; + $link_start = ''; + $link_end = ''; + } + + my $text = join '', ($link_start, escape($order->$number_method), $link_end); is_escaped($text); } diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 76fa8568d..cdaba2534 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -840,7 +840,9 @@ sub orders { my $callback = $form->escape($href); my $edit_url = build_std_url('action=edit', 'type', 'vc'); - my $edit_order_url = build_std_url('script=oe.pl', 'type=' . ($form->{type} eq 'sales_delivery_order' ? 'sales_order' : 'purchase_order'), 'action=edit'); + my $edit_order_url = ($::instance_conf->get_feature_experimental) + ? build_std_url('script=controller.pl', 'action=Order/edit', 'type=' . ($form->{type} eq 'sales_delivery_order' ? 'sales_order' : 'purchase_order')) + : build_std_url('script=oe.pl', 'action=edit', 'type=' . ($form->{type} eq 'sales_delivery_order' ? 'sales_order' : 'purchase_order')); my $idx = 1; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 7832b2e39..940d07660 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1008,7 +1008,7 @@ sub orders { my @columns = ( "transdate", "reqdate", - "id", $ordnumber, "edit_exp", + "id", $ordnumber, "cusordnumber", "customernumber", "name", "netamount", "tax", "amount", @@ -1035,7 +1035,6 @@ sub orders { $form->{l_open} = $form->{l_closed} = "Y" if ($form->{open} && $form->{closed}); $form->{l_delivered} = "Y" if ($form->{delivered} && $form->{notdelivered}); $form->{l_periodic_invoices} = "Y" if ($form->{periodic_invoices_active} && $form->{periodic_invoices_inactive}); - $form->{l_edit_exp} = "Y" if $::instance_conf->get_feature_experimental && (any { $form->{type} eq $_ } qw(sales_order purchase_order sales_quotation request_quotation)); map { $form->{"l_${_}"} = 'Y' } qw(order_probability expected_billing_date expected_netamount) if $form->{l_order_probability_expected_billing_date}; my $attachment_basename; @@ -1117,7 +1116,6 @@ sub orders { 'expected_billing_date' => { 'text' => $locale->text('Exp. bill. date'), }, 'expected_netamount' => { 'text' => $locale->text('Exp. netamount'), }, 'payment_terms' => { 'text' => $locale->text('Payment Terms'), }, - 'edit_exp' => { 'text' => $locale->text('Edit (experimental)'), }, %column_defs_cvars, ); @@ -1225,7 +1223,9 @@ sub orders { my $idx = 1; - my $edit_url = build_std_url('action=edit', 'type', 'vc'); + my $edit_url = ($::instance_conf->get_feature_experimental) + ? build_std_url('script=controller.pl', 'action=Order/edit', 'type') + : build_std_url('action=edit', 'type', 'vc'); foreach my $oe (@{ $form->{OE} }) { map { $oe->{$_} *= $oe->{exchangerate} } @subtotal_columns; @@ -1249,7 +1249,6 @@ sub orders { foreach my $column (@columns) { next if ($column eq 'ids'); - next if ($column eq 'edit_exp'); $row->{$column} = { 'data' => $oe->{$column}, 'align' => $column_alignment{$column}, @@ -1265,9 +1264,6 @@ sub orders { $row->{$ordnumber}->{link} = $edit_url . "&id=" . E($oe->{id}) . "&callback=${callback}"; - $row->{edit_exp}->{data} = $oe->{$ordnumber}; - $row->{edit_exp}->{link} = build_std_url('script=controller.pl', 'action=Order/edit', "type=$form->{type}", 'id=' . E($oe->{id})); - my $row_set = [ $row ]; if (($form->{l_subtotal} eq 'Y') @@ -2137,7 +2133,9 @@ sub report_for_todo_list { my $content; if (@{ $quotations }) { - my $edit_url = build_std_url('script=oe.pl', 'action=edit'); + my $edit_url = ($::instance_conf->get_feature_experimental) + ? build_std_url('script=controller.pl', 'action=Order/edit') + : build_std_url('script=oe.pl', 'action=edit'); $content = $form->parse_html_template('oe/report_for_todo_list', { 'QUOTATIONS' => $quotations, 'edit_url' => $edit_url }); diff --git a/menus/user/10-order-controller.yaml b/menus/user/10-order-controller.yaml index e36c7c93a..fc0bb664e 100644 --- a/menus/user/10-order-controller.yaml +++ b/menus/user/10-order-controller.yaml @@ -1,6 +1,19 @@ +- parent: ar + id: ar_add_quotation + access: sales_quotation_edit & (!client/feature_experimental) +- parent: ar + id: ar_add_sales_order + access: sales_order_edit & (!client/feature_experimental) +- parent: ap + id: ap_add_rfq + access: request_quotation_edit & (!client/feature_experimental) +- parent: ap + id: ap_add_purchase_order + access: purchase_order_edit & (!client/feature_experimental) + - parent: ar id: ar_add_quotation_experimental - name: Add Quotation (experimental) + name: Add Quotation icon: quotation_add order: 250 access: sales_quotation_edit & client/feature_experimental @@ -9,7 +22,7 @@ type: sales_quotation - parent: ar id: ar_add_sales_order_experimental - name: Add Sales Order (experimental) + name: Add Sales Order icon: sales_order_add order: 350 access: sales_order_edit & client/feature_experimental @@ -19,7 +32,7 @@ - parent: ap id: ap_add_rfq_experimental - name: Add RFQ (experimental) + name: Add RFQ icon: rfq_add order: 150 access: request_quotation_edit & client/feature_experimental @@ -28,7 +41,7 @@ type: request_quotation - parent: ap id: ap_add_purchase_order_experimental - name: Add Purchase Order (experimental) + name: Add Purchase Order icon: purchase_order_add order: 250 access: purchase_order_edit & client/feature_experimental -- 2.20.1