From 15b67fd51a4e9d274205f59a9f50c4ce86b5e176 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 18 Feb 2016 17:16:09 +0100 Subject: [PATCH] Erzeugnissuche --- SL/IC.pm | 7 +++++++ SL/Layout/Top.pm | 2 +- js/quicksearch_input.js | 12 +++++++++--- locale/de/all | 6 +++++- templates/webpages/menu/header.html | 3 +++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/SL/IC.pm b/SL/IC.pm index d4b341340..1a02c59c6 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -872,6 +872,13 @@ sub all_parts { } } + # special case smart search + if ($form->{all}) { + $form->{"l_$_"} = 1 for qw(partnumber description unit sellprice lastcost cvar_packaging linetotal); + push @where_tokens, "p.partnumber ILIKE ? OR p.description ILIKE ?"; + push @bind_vars, "%$form->{all}%", "%$form->{all}%"; + } + # special case insertdate if (grep { $form->{$_} } qw(insertdatefrom insertdateto)) { $form->{"l_insertdate"} = 1; diff --git a/SL/Layout/Top.pm b/SL/Layout/Top.pm index e2e5d2df6..e509da1d7 100644 --- a/SL/Layout/Top.pm +++ b/SL/Layout/Top.pm @@ -18,7 +18,7 @@ sub stylesheets { } sub javascripts { - ('jquery-ui.js', 'quicksearch_input.js') x!! $::auth->assert('customer_vendor_edit', 1), + ('jquery-ui.js', 'quicksearch_input.js') x!! $::auth->assert('customer_vendor_edit|part_service_assembly_edit', 1), ('jquery-ui.js', 'glquicksearch.js') x!! $::auth->assert('general_ledger', 1) } diff --git a/js/quicksearch_input.js b/js/quicksearch_input.js index e281f94d3..02e4cf3ea 100644 --- a/js/quicksearch_input.js +++ b/js/quicksearch_input.js @@ -15,10 +15,16 @@ function on_keydown_quicksearch(event) { if (!value) return true; - var url = "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=" + encodeURIComponent(value); + url = { + frame_header_contact_search: "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=", + frame_header_parts_search: "ic.pl?action=generate_report&INPUT_ENCODING=utf-8&searchitems=assembly&all=" + }[element.attr('id')]; - window.location.href = url; + window.location.href = url + encodeURIComponent(value); return false; } -$(function(){ $('#frame_header_contact_search').keydown(on_keydown_quicksearch) }); +$(function(){ + $('#frame_header_contact_search').keydown(on_keydown_quicksearch); + $('#frame_header_parts_search').keydown(on_keydown_quicksearch); +}); diff --git a/locale/de/all b/locale/de/all index 03bb3c4c5..440f9fea0 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2405,7 +2405,11 @@ $self->{texts} = { 'Search AP Aging' => 'Offene Verbindlichkeiten', 'Search AR Aging' => 'Offene Forderungen', 'Search bank transactions' => 'Filter für Bankbuchungen', - 'Search contacts' => 'Ansprechpersonensuche', + 'Search contacts' => 'Personensuche', + 'Search email journal' => 'Emailjournal durchsuchen', + 'Search for delivered parts' => 'gelieferten Artikeln', + 'Search for undelivered parts' => 'zu liefernden Artikeln', + 'Search parts' => 'Erzeugnissuche', 'Search projects' => 'Projektsuche', 'Search term' => 'Suchbegriff', 'Searchable' => 'Durchsuchbar', diff --git a/templates/webpages/menu/header.html b/templates/webpages/menu/header.html index f7ba0ee3a..533f4a430 100644 --- a/templates/webpages/menu/header.html +++ b/templates/webpages/menu/header.html @@ -5,6 +5,9 @@ [[% 'New window/tab' | $T8 %]] [[% 'Print' | $T8 %]] +[%- IF AUTH.assert('part_service_assembly_edit', 1) %] + [] +[%- END %] [%- IF AUTH.assert('customer_vendor_edit|customer_vendor_edit_all', 1) %] [] [%- END %] -- 2.20.1