From a9c191deed45bf13c5a6983ad0409fd7cb0e86d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 23 Jan 2017 16:36:16 +0100 Subject: [PATCH] Reste von altem autocomplete feature entfernt --- SL/IC.pm | 2 +- bin/mozilla/ic.pl | 19 ------- scripts/locales.pl | 2 +- templates/webpages/generic/autocomplete.html | 58 -------------------- templates/webpages/ic/ajax_autocomplete.html | 6 -- 5 files changed, 2 insertions(+), 85 deletions(-) delete mode 100644 templates/webpages/generic/autocomplete.html delete mode 100644 templates/webpages/ic/ajax_autocomplete.html diff --git a/SL/IC.pm b/SL/IC.pm index ce3bc00a8..08dfe1237 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -602,7 +602,7 @@ SQL $main::lxdebug->leave_sub(); - return @{ $form->{parts} }; + return $form->{parts}; } sub _create_filter_for_priceupdate { diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 320538229..8f4702cd1 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -668,25 +668,6 @@ sub generate_report { $lxdebug->leave_sub(); } #end generate_report -sub ajax_autocomplete { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $form->{column} = 'description' unless $form->{column} =~ /^partnumber|description$/; - $form->{$form->{column}} = $form->{q} || ''; - $form->{limit} = ($form->{limit} * 1) || 10; - $form->{searchitems} ||= ''; - - my @results = IC->all_parts(\%myconfig, $form); - - print $form->ajax_response_header(), - $form->parse_html_template('ic/ajax_autocomplete'); - - $main::lxdebug->leave_sub(); -} - sub back_to_record { _check_io_auth(); diff --git a/scripts/locales.pl b/scripts/locales.pl index 29319632f..105ca7cae 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -57,7 +57,7 @@ our $missing = {}; our @lost = (); my %ignore_unused_templates = ( - map { $_ => 1 } qw(ct/testpage.html generic/autocomplete.html oe/periodic_invoices_email.txt part/testpage.html t/render.html t/render.js task_server/failure_notification_email.txt + map { $_ => 1 } qw(ct/testpage.html oe/periodic_invoices_email.txt part/testpage.html t/render.html t/render.js task_server/failure_notification_email.txt failed_background_jobs_report/email.txt) ); diff --git a/templates/webpages/generic/autocomplete.html b/templates/webpages/generic/autocomplete.html deleted file mode 100644 index 5bd35c0b2..000000000 --- a/templates/webpages/generic/autocomplete.html +++ /dev/null @@ -1,58 +0,0 @@ -[%#- - Autocompletion - - This template enables auto completion for input fields. - Calling Syntax is: - - INCLUDE 'generic/autocomplete', [ - { SPEC_1 }, - { SPEC_2 }, - ... - ] - - where SPEC is a hash containing the following keys: - - script : the script that is called for autocompletion, defaults to the invoking script - action : action in the ajax script, defaults to 'ajax_autocomplete' - selector : a jquery selector, specifying the input fields - column : specifies the column that is represented by the bound field. typically description or name. - params : additional params that should be included in the request, like customer/vendor information. expects a hash. - - TODO FIELDS: - - addition fields like type, vc etc. - - additional dependencies, see jquery.autocomplete documentation - - hook function on select, again see jquery documentation - - limit: maximum number of results shown. - - a simple SPEC would look like this: - - { selector => '#description', column => 'description' } - # field with id="description" should be autocompleted with descriptions - - { script => 'ic.pl', selector => '[name^="partnumber_"]', column => 'partnumber' } - # let ic.pl autocomplete by partnumbers, bind this to all fields where the name begins with "partnumber_" - - - - The Backend Side - - The called function will recieve the queried string as hashkey "q" in form, as well as every other param specified here. - It should generate a generic ajax header (see form), followed by newline separated list of possible completion values. - -%] - diff --git a/templates/webpages/ic/ajax_autocomplete.html b/templates/webpages/ic/ajax_autocomplete.html deleted file mode 100644 index 5bbd3b622..000000000 --- a/templates/webpages/ic/ajax_autocomplete.html +++ /dev/null @@ -1,6 +0,0 @@ -[%- USE HTML %] -[%- FOREACH part = parts %] -[% IF loop.count < limit %] -[% part.$column %] -[%- END %] -[%- END %] -- 2.20.1