From 2eaa39366f97994db3548a9b139d35b16fbb0903 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 26 Sep 2018 11:20:36 +0200 Subject: [PATCH] Toten Code entfernt: customer_or_vendor_selection.js MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bevor es den Customer-Picker gab, bestand die Möglichkeit über einen Klick auf ein Fragezeichen den Kunden/Lieferanten rauszusuchen. Die Funktion war noch ein bisschen erweitert, da der Ansprechpartner noch separat angezeigt wurde (toter Projektcode im Standard ?), die zusätzlich Auswahl-Funktion hatte keine weitere Auswirkung. Die aktuelle einzige Stelle, wo der Code noch geladen wurde ist im Letter-Controller. Das Deaktivieren des js-Codes zeigt, wie erwartet, keine Unterschiede im Verhalten => Alles mittlerweile komplett überflüssig, inkl. edit_part.js (?) in Letter.pm --- SL/Controller/Letter.pm | 3 - bin/mozilla/common.pl | 55 ----------- js/customer_or_vendor_selection.js | 15 --- templates/webpages/generic/cov_selection.html | 96 ------------------- 4 files changed, 169 deletions(-) delete mode 100644 js/customer_or_vendor_selection.js delete mode 100644 templates/webpages/generic/cov_selection.html diff --git a/SL/Controller/Letter.pm b/SL/Controller/Letter.pm index b16a91365..36f927573 100644 --- a/SL/Controller/Letter.pm +++ b/SL/Controller/Letter.pm @@ -323,9 +323,6 @@ sub _display { $::form->{type} = 'letter'; # needed for print_options $::form->{vc} = $letter->is_sales ? 'customer' : 'vendor'; # needs to be for _get_contacts... - $::request->layout->add_javascripts('customer_or_vendor_selection.js'); - $::request->layout->add_javascripts('edit_part_window.js'); - $::form->{language_id} ||= $params{language_id}; $::form->{languages} ||= SL::DB::Manager::Language->get_all_sorted; $::form->{printers} = SL::DB::Manager::Printer->get_all_sorted; diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 5eb06c9ea..19955c1ca 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -332,62 +332,7 @@ sub retrieve_partunits { # ------------------------------------------------------------------------- -sub cov_selection_internal { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - my $order_by = "name"; - $order_by = $form->{"order_by"} if (defined($form->{"order_by"})); - my $order_dir = 1; - $order_dir = $form->{"order_dir"} if (defined($form->{"order_dir"})); - - my $type = $form->{"is_vendor"} ? $locale->text("vendor") : $locale->text("customer"); - - my $covs = Common->retrieve_customers_or_vendors(\%myconfig, $form, $order_by, $order_dir, $form->{"is_vendor"}, $form->{"allow_both"}); - map({ $covs->[$_]->{"selected"} = $_ ? 0 : 1; } (0..$#{$covs})); - - if (0 == scalar(@{$covs})) { - $form->show_generic_information(sprintf($locale->text("No %s was found matching the search parameters."), $type)); - } elsif (1 == scalar(@{$covs})) { - $::request->{layout}->add_javascripts_inline("cov_selected('1')"); - } - - my $callback = "$form->{script}?action=cov_selection_internal&"; - map({ $callback .= "$_=" . $form->escape($form->{$_}) . "&" } - (qw(name input_name input_id is_vendor allow_both), grep({ /^[fl]_/ } keys %$form))); - my @header_sort = qw(name address contact); - my %header_title = ( "name" => $locale->text("Name"), - "address" => $locale->text("Address"), - "contact" => $locale->text("Contact"), - ); - - my @header = - map(+{ "column_title" => $header_title{$_}, - "column" => $_, - "callback" => $callback . "order_by=${_}&order_dir=" . ($order_by eq $_ ? 1 - $order_dir : $order_dir), - }, - @header_sort); - - foreach my $cov (@{ $covs }) { - $cov->{address} = "$cov->{street}, $cov->{zipcode} $cov->{city}"; - $cov->{address} =~ s{^,}{}x; - $cov->{address} =~ s{\ +}{\ }gx; - - $cov->{contact} = join " ", map { $cov->{$_} } qw(cp_gender cp_title cp_givenname cp_name); - $cov->{contact} =~ s{\ +}{\ }gx; - } - - $form->{"title"} = $form->{is_vendor} ? $locale->text("Select a vendor") : $locale->text("Select a customer"); - $form->header(); - print($form->parse_html_template("generic/cov_selection", { "HEADER" => \@header, - "COVS" => $covs, })); - - $main::lxdebug->leave_sub(); -} # Functions to call add routines beneath different reports diff --git a/js/customer_or_vendor_selection.js b/js/customer_or_vendor_selection.js deleted file mode 100644 index b09183f7c..000000000 --- a/js/customer_or_vendor_selection.js +++ /dev/null @@ -1,15 +0,0 @@ -function customer_or_vendor_selection_window(input_name, input_id, is_vendor, allow_both, action_on_cov_selected) { - var parm = centerParms(800,600) + ",width=800,height=600,status=yes,scrollbars=yes"; - var name = document.getElementsByName(input_name)[0].value; - url = "common.pl?" + - "INPUT_ENCODING=UTF-8&" + - "action=cov_selection_internal&" + - "name=" + encodeURIComponent(name) + "&" + - "input_name=" + encodeURIComponent(input_name) + "&" + - "input_id=" + encodeURIComponent(input_id) + "&" + - "is_vendor=" + (is_vendor ? "1" : "0") + "&" + - "allow_both=" + (allow_both ? "1" : "0") + "&" + - "action_on_cov_selected=" + (action_on_cov_selected ? encodeURIComponent(action_on_cov_selected) : "") - //alert(url); - window.open(url, "_new_cov_selection", parm); -} diff --git a/templates/webpages/generic/cov_selection.html b/templates/webpages/generic/cov_selection.html deleted file mode 100644 index a2db0d4bb..000000000 --- a/templates/webpages/generic/cov_selection.html +++ /dev/null @@ -1,96 +0,0 @@ -[%- USE T8 %] -[%- USE HTML %] -

[% title %]

- -
- - - - - - - - - - [%- IF !is_vendor %] - [% 'Please select a customer from the list below.' | $T8 %] - [%- ELSE %] - [% 'Please select a vendor from the list below.' | $T8 %] - [%- END %] - - - - - - - - - - [%- FOREACH row = HEADER %] - - [%- END %] - - - [%- FOREACH row = COVS %] - - - - - - - [% END %] -
 [% row.column_title %]
- - - [% HTML.escape(row.name) %][% HTML.escape(row.address) %][% HTML.escape(row.contact) %]
- - - - - -
- - - -- 2.20.1