From c3db1b36f46f3bb8fe278ad3320bc7b139278dc3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 3 Aug 2018 16:34:36 +0200 Subject: [PATCH] Auftrags-Controller: weitere Links hierhin bei experimentellen Features --- SL/Controller/DeliveryPlan.pm | 6 +++- SL/Controller/DeliveryValueReport.pm | 6 +++- SL/Controller/FinancialControllingReport.pm | 6 +++- SL/Controller/SellPriceInformation.pm | 6 +++- SL/Controller/ShopOrder.pm | 3 +- SL/Controller/TopQuickSearch/OERecord.pm | 23 +++++++++---- SL/FU.pm | 32 ++++++++++++++++--- bin/mozilla/ct.pl | 6 ++++ bin/mozilla/ic.pl | 13 ++++++-- .../customer_vendor/get_delivery.html | 6 +++- .../list_sales_delivery_orders.html | 6 +++- .../webpages/requirement_spec_order/list.html | 6 +++- 12 files changed, 98 insertions(+), 21 deletions(-) diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index 6e6eed403..95db7ff6a 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -369,7 +369,11 @@ sub link_to { my $vc = $object->is_sales ? 'customer' : 'vendor'; my $id = $object->id; - return "oe.pl?action=$action&type=$type&vc=$vc&id=$id"; + if ($::instance_conf->get_feature_experimental) { + return "controller.pl?action=Order/$action&type=$type&id=$id"; + } else { + return "oe.pl?action=$action&type=$type&vc=$vc&id=$id"; + } } if ($object->isa('SL::DB::Part')) { my $id = $object->id; diff --git a/SL/Controller/DeliveryValueReport.pm b/SL/Controller/DeliveryValueReport.pm index 0a714d2a2..942b02a23 100644 --- a/SL/Controller/DeliveryValueReport.pm +++ b/SL/Controller/DeliveryValueReport.pm @@ -231,7 +231,11 @@ sub link_to { my $vc = $object->is_sales ? 'customer' : 'vendor'; my $id = $object->id; - return "oe.pl?action=$action&type=$type&vc=$vc&id=$id"; + if ($::instance_conf->get_feature_experimental) { + return "controller.pl?action=Order/$action&type=$type&id=$id"; + } else { + return "oe.pl?action=$action&type=$type&vc=$vc&id=$id"; + } } if ($object->isa('SL::DB::Part')) { my $id = $object->id; diff --git a/SL/Controller/FinancialControllingReport.pm b/SL/Controller/FinancialControllingReport.pm index 7b392f184..31f60f13d 100644 --- a/SL/Controller/FinancialControllingReport.pm +++ b/SL/Controller/FinancialControllingReport.pm @@ -278,7 +278,11 @@ sub link_to { my $type = $object->type; my $id = $object->id; - return "oe.pl?action=$action&type=$type&vc=customer&id=$id"; + if ($::instance_conf->get_feature_experimental) { + return "controller.pl?action=Order/$action&type=$type&id=$id"; + } else { + return "oe.pl?action=$action&type=$type&vc=customer&id=$id"; + } } if ($object->isa('SL::DB::Customer')) { my $id = $object->id; diff --git a/SL/Controller/SellPriceInformation.pm b/SL/Controller/SellPriceInformation.pm index b0e96c3af..1385fca5f 100644 --- a/SL/Controller/SellPriceInformation.pm +++ b/SL/Controller/SellPriceInformation.pm @@ -140,7 +140,11 @@ sub link_to { my $vc = $object->is_sales ? 'customer' : 'vendor'; my $id = $object->id; - return "oe.pl?action=$action&type=$type&vc=$vc&id=$id"; + if ($::instance_conf->get_feature_experimental) { + return "controller.pl?action=Order/$action&type=$type&id=$id"; + } else { + return "oe.pl?action=$action&type=$type&vc=$vc&id=$id"; + } } if ($object->isa('SL::DB::Customer')) { my $id = $object->id; diff --git a/SL/Controller/ShopOrder.pm b/SL/Controller/ShopOrder.pm index f88a853bd..1503e6f68 100644 --- a/SL/Controller/ShopOrder.pm +++ b/SL/Controller/ShopOrder.pm @@ -156,7 +156,8 @@ sub action_transfer { $self->shop_order->save; $self->shop_order->link_to_record($order); }) || die $order->db->error; - $self->redirect_to(controller => "oe.pl", action => 'edit', type => 'sales_order', vc => 'customer', id => $order->id); + my $order_controller = $::instance_conf->get_feature_experimental ? 'Order' :'oe.pl'; + $self->redirect_to(controller => $order_controller, action => 'edit', type => 'sales_order', vc => 'customer', id => $order->id); } } diff --git a/SL/Controller/TopQuickSearch/OERecord.pm b/SL/Controller/TopQuickSearch/OERecord.pm index 8379608d4..ecbca1300 100644 --- a/SL/Controller/TopQuickSearch/OERecord.pm +++ b/SL/Controller/TopQuickSearch/OERecord.pm @@ -64,13 +64,22 @@ sub redirect_to_search { } sub redirect_to_object { - SL::Controller::Base->new->url_for( - controller => 'oe.pl', - action => 'edit', - type => $_[0]->type, - vc => $_[0]->vc, - id => $_[1], - ); + if ($::instance_conf->get_feature_experimental) { + SL::Controller::Base->new->url_for( + controller => 'Order', + action => 'edit', + type => $_[0]->type, + id => $_[1], + ); + } else { + SL::Controller::Base->new->url_for( + controller => 'oe.pl', + action => 'edit', + type => $_[0]->type, + vc => $_[0]->vc, + id => $_[1], + ); + } } sub type { diff --git a/SL/FU.pm b/SL/FU.pm index 83ec776bc..8f52ae4cd 100644 --- a/SL/FU.pm +++ b/SL/FU.pm @@ -336,8 +336,14 @@ sub link_details { }; } elsif ($params{trans_type} eq 'sales_quotation') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=sales_quotation&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=sales_quotation&id=' . $params{trans_id}, 'title' => $locale->text('Sales quotation') . " $params{trans_info}", }; @@ -356,8 +362,14 @@ sub link_details { }; } elsif ($params{trans_type} eq 'sales_order') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=sales_order&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=sales_order&id=' . $params{trans_id}, 'title' => $locale->text('Sales Order') . " $params{trans_info}", }; @@ -386,14 +398,26 @@ sub link_details { }; } elsif ($params{trans_type} eq 'request_quotation') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=request_quotation&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=request_quotation&id=' . $params{trans_id}, 'title' => $locale->text('Request quotation') . " $params{trans_info}", }; } elsif ($params{trans_type} eq 'purchase_order') { + my $script = 'oe.pl'; + my $action = 'edit'; + if ($::instance_conf->get_feature_experimental) { + $script = 'controller.pl'; + $action = 'Order/edit'; + } $link = { - 'url' => 'oe.pl?action=edit&type=purchase_order&id=' . $params{trans_id}, + 'url' => $script . '?action=' . $action . '&type=purchase_order&id=' . $params{trans_id}, 'title' => $locale->text('Purchase Order') . " $params{trans_info}", }; diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index ba2a86aff..079b24c4a 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -286,6 +286,12 @@ sub list_names { } my $base_url = build_std_url("script=$ref->{module}.pl", 'action=edit', 'id=' . E($ref->{invid}), 'callback', @hidden_nondefault); + if ($::instance_conf->get_feature_experimental) { + if ('oe' eq $ref->{module}) { + $base_url = build_std_url("script=controller.pl", 'action=Order/edit', 'id=' . E($ref->{invid}), 'callback', @hidden_nondefault); + } + } + $row->{invnumber}->{link} = $base_url; $row->{ordnumber}->{link} = $base_url . "&type=${ordertype}"; $row->{quonumber}->{link} = $base_url . "&type=${quotationtype}"; diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 35affe9a0..b0d3887ba 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -541,8 +541,17 @@ sub generate_report { # | ist bestellt | Von Kunden bestellt | -> edit_oe_ord_link # | Anfrage | Angebot | -> edit_oe_quo_link - my $edit_oe_ord_link = build_std_url("script=oe.pl", 'action=edit', 'type=' . E($ref->{cv} eq 'vendor' ? 'purchase_order' : 'sales_order'), 'id=' . E($ref->{trans_id}), 'callback'); - my $edit_oe_quo_link = build_std_url("script=oe.pl", 'action=edit', 'type=' . E($ref->{cv} eq 'vendor' ? 'request_quotation' : 'sales_quotation'), 'id=' . E($ref->{trans_id}), 'callback'); + my $edit_oe_ord_link = ($::instance_conf->get_feature_experimental) + ? build_std_url("script=controller.pl", 'action=Order/edit', + 'type=' . E($ref->{cv} eq 'vendor' ? 'purchase_order' : 'sales_order'), 'id=' . E($ref->{trans_id}), 'callback') + : build_std_url("script=oe.pl", 'action=edit', + 'type=' . E($ref->{cv} eq 'vendor' ? 'purchase_order' : 'sales_order'), 'id=' . E($ref->{trans_id}), 'callback'); + + my $edit_oe_quo_link = ($::instance_conf->get_feature_experimental) + ? build_std_url("script=controller.pl", 'action=Order/edit', + 'type=' . E($ref->{cv} eq 'vendor' ? 'request_quotation' : 'sales_quotation'), 'id=' . E($ref->{trans_id}), 'callback') + : build_std_url("script=oe.pl", 'action=edit', + 'type=' . E($ref->{cv} eq 'vendor' ? 'request_quotation' : 'sales_quotation'), 'id=' . E($ref->{trans_id}), 'callback'); $row->{ordnumber}{link} = $edit_oe_ord_link; $row->{quonumber}{link} = $edit_oe_quo_link if (!$ref->{ordnumber}); diff --git a/templates/webpages/customer_vendor/get_delivery.html b/templates/webpages/customer_vendor/get_delivery.html index 5250110b3..debe697db 100644 --- a/templates/webpages/customer_vendor/get_delivery.html +++ b/templates/webpages/customer_vendor/get_delivery.html @@ -27,7 +27,11 @@ [% HTML.escape(row.shiptoname) UNLESS loop.prev.shiptoname == row.shiptoname %]  [% IF row.id %][% END %][% HTML.escape(row.invnumber) || ' ' %][% IF row.id %][% END %] - [% IF row.oe_id %][% END %][% HTML.escape(row.ordnumber) || ' ' %][% IF row.oe_id %][% END %] + [%- IF INSTANCE_CONF.get_feature_experimental -%] + [% IF row.oe_id %][% END %][% HTML.escape(row.ordnumber) || ' ' %][% IF row.oe_id %][% END %] + [%- ELSE -%] + [% IF row.oe_id %][% END %][% HTML.escape(row.ordnumber) || ' ' %][% IF row.oe_id %][% END %] + [%- END -%] [% HTML.escape(row.transdate) || ' ' %] [% HTML.escape(row.description) || ' ' %] [% HTML.escape(row.qty) || ' ' %] diff --git a/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html b/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html index 5b8a14234..f4a8c7a22 100644 --- a/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html +++ b/templates/webpages/mass_invoice_create_print_from_do/list_sales_delivery_orders.html @@ -36,7 +36,11 @@ [% L.checkbox_tag('id[]', value=sales_delivery_order.id, "data-checkall"=1) %] [% HTML.escape(sales_delivery_order.transdate_as_date) %] [% L.link(SELF.url_for(controller="do.pl", action="edit", type="sales_delivery_order", id=sales_delivery_order.id), sales_delivery_order.donumber) %] - [% L.link(SELF.url_for(controller="oe.pl", action="edit", type="sales_order", id=sales_delivery_order.sales_order.id), sales_delivery_order.ordnumber) %] + [%- IF INSTANCE_CONF.get_feature_experimental -%] + [% L.link(SELF.url_for(controller="controller.pl", action="Order/edit", type="sales_order", id=sales_delivery_order.sales_order.id), sales_delivery_order.ordnumber) %] + [%- ELSE -%] + [% L.link(SELF.url_for(controller="oe.pl", action="edit", type="sales_order", id=sales_delivery_order.sales_order.id), sales_delivery_order.ordnumber) %] + [%- END -%] [% HTML.escape(sales_delivery_order.customer.name) %] [%- END %] diff --git a/templates/webpages/requirement_spec_order/list.html b/templates/webpages/requirement_spec_order/list.html index 4f8278d19..3ee5f0bbc 100644 --- a/templates/webpages/requirement_spec_order/list.html +++ b/templates/webpages/requirement_spec_order/list.html @@ -79,7 +79,11 @@ [% END %] - + [%- IF INSTANCE_CONF.get_feature_experimental -%] + + [%- ELSE -%] + + [%- END -%] [% HTML.escape(rs_order.order.quotation ? rs_order.order.quonumber : rs_order.order.ordnumber) %] -- 2.20.1