From e03993be556024f24e5a4940fa08078ee8cd3840 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Mon, 24 Jun 2013 12:51:19 +0200 Subject: [PATCH] Customer/Vendor-Pfade angepasst --- SL/Controller/CustomerVendor.pm | 27 +++++++++++++++++++ SL/Controller/DeliveryPlan.pm | 2 +- SL/Controller/SellPriceInformation.pm | 2 +- SL/FU.pm | 4 +-- SL/Presenter/CustomerVendor.pm | 2 +- menu.ini | 21 ++++++++------- .../webpages/sepa/bank_transfer_add.html | 2 +- .../webpages/sepa/bank_transfer_create.html | 2 +- 8 files changed, 45 insertions(+), 17 deletions(-) diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index 04042fdb5..0fc7206dc 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -291,6 +291,33 @@ sub action_delete_shipto { $self->action_edit(); } + +sub action_search { + my ($self) = @_; + + my $url = 'ct.pl?action=search&db='. ($self->is_vendor() ? 'vendor' : 'customer'); + + if ( $::form->{callback} ) { + $url .= '&callback='. $::from->escape($::form->{callback}); + } + + print $::form->redirect_header($url); +} + + +sub action_search_contact { + my ($self) = @_; + + my $url = 'ct.pl?action=search_contact&db=customer'; + + if ( $::form->{callback} ) { + $url .= '&callback='. $::from->escape($::form->{callback}); + } + + print $::form->redirect_header($url); +} + + sub action_get_delivery { my ($self) = @_; diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index 00adfc9f5..b8ee1c41d 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -228,7 +228,7 @@ sub link_to { } if ($object->isa('SL::DB::Customer')) { my $id = $object->id; - return "ct.pl?action=$action&id=$id&db=customer"; + return "controller.pl?action=CustomerVendor/$action&id=$id&db=customer"; } } diff --git a/SL/Controller/SellPriceInformation.pm b/SL/Controller/SellPriceInformation.pm index f31f53e28..8e0c52d86 100644 --- a/SL/Controller/SellPriceInformation.pm +++ b/SL/Controller/SellPriceInformation.pm @@ -141,7 +141,7 @@ sub link_to { } if ($object->isa('SL::DB::Customer')) { my $id = $object->id; - return "ct.pl?action=$action&id=$id&db=customer"; + return "controller.pl?action=CustomerVendor/$action&id=$id&db=customer"; } } diff --git a/SL/FU.pm b/SL/FU.pm index a005c1814..8131a2cea 100644 --- a/SL/FU.pm +++ b/SL/FU.pm @@ -314,13 +314,13 @@ sub link_details { if ($params{trans_type} eq 'customer') { $link = { - 'url' => 'ct.pl?action=edit&db=customer&id=' . $form->quote($params{trans_id}) . '&edit_note_id=' . $form->quote($params{note_id}), + 'url' => 'controller.pl?action=CustomerVendor/edit&db=customer&id=' . $form->quote($params{trans_id}) . '&edit_note_id=' . $form->quote($params{note_id}), 'title' => $locale->text('Customer') . " '$params{trans_info}'", }; } elsif ($params{trans_type} eq 'vendor') { $link = { - 'url' => 'ct.pl?action=edit&type=sales_quotation&id=' . $params{trans_id} . '&edit_note_id=' . $form->quote($params{note_id}), + 'url' => 'controller.pl?action=CustomerVendor/edit&type=sales_quotation&id=' . $params{trans_id} . '&edit_note_id=' . $form->quote($params{note_id}), 'title' => $locale->text('Vendor') . " '$params{trans_info}'", }; diff --git a/SL/Presenter/CustomerVendor.pm b/SL/Presenter/CustomerVendor.pm index 077c376c8..6d24409d2 100644 --- a/SL/Presenter/CustomerVendor.pm +++ b/SL/Presenter/CustomerVendor.pm @@ -27,7 +27,7 @@ sub _customer_vendor { croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/; my $text = join '', ( - $params{no_link} ? '' : '', + $params{no_link} ? '' : '', $self->escape($cv->name), $params{no_link} ? '' : '', ); diff --git a/menu.ini b/menu.ini index 5031c98af..b0bff6139 100644 --- a/menu.ini +++ b/menu.ini @@ -2,14 +2,14 @@ [Master Data--Add Customer] ACCESS=customer_vendor_edit -module=ct.pl -action=add +module=controller.pl +action=CustomerVendor/add db=customer [Master Data--Add Vendor] ACCESS=customer_vendor_edit -module=ct.pl -action=add +module=controller.pl +action=CustomerVendor/add db=vendor [Master Data--Add Part] @@ -48,20 +48,21 @@ submenu=1 [Master Data--Reports--Customers] ACCESS=customer_vendor_edit -module=ct.pl -action=search +module=controller.pl +action=CustomerVendor/search db=customer [Master Data--Reports--Vendors] ACCESS=customer_vendor_edit -module=ct.pl -action=search +module=controller.pl +action=CustomerVendor/search db=vendor [Master Data--Reports--Contacts] ACCESS=customer_vendor_edit -module=ct.pl -action=search_contact +module=controller.pl +action=CustomerVendor/search_contact +db=customer [Master Data--Reports--Parts] ACCESS=part_service_assembly_details diff --git a/templates/webpages/sepa/bank_transfer_add.html b/templates/webpages/sepa/bank_transfer_add.html index e156b7ea1..fe2d44194 100644 --- a/templates/webpages/sepa/bank_transfer_add.html +++ b/templates/webpages/sepa/bank_transfer_add.html @@ -52,7 +52,7 @@ [%- IF loop.first || (previous_vcname != invoice.vcname) %] - + [%- GET HTML.escape(invoice.vcname); SET previous_vcname = invoice.vcname; IF !invoice.vc_bank_info_ok; diff --git a/templates/webpages/sepa/bank_transfer_create.html b/templates/webpages/sepa/bank_transfer_create.html index 89421a69e..561baec31 100644 --- a/templates/webpages/sepa/bank_transfer_create.html +++ b/templates/webpages/sepa/bank_transfer_create.html @@ -86,7 +86,7 @@ [%- IF loop.first || (previous_vcname != bank_transfer.vcname) %] - + [%- GET HTML.escape(bank_transfer.vcname); SET previous_vcname = bank_transfer.vcname; -%] -- 2.20.1