Erzeugnissuche
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 18 Feb 2016 16:16:09 +0000 (17:16 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 22 Mar 2016 12:25:36 +0000 (13:25 +0100)
SL/IC.pm
SL/Layout/Top.pm
js/quicksearch_input.js
locale/de/all
templates/webpages/menu/header.html

index d4b3413..1a02c59 100644 (file)
--- 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;
index e2e5d2d..e509da1 100644 (file)
@@ -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)
 }
 
index e281f94..02e4cf3 100644 (file)
@@ -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);
+});
index 03bb3c4..440f9fe 100755 (executable)
@@ -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',
index f7ba0ee..533f4a4 100644 (file)
@@ -5,6 +5,9 @@
  <span class="frame-header-element frame-header-left">
     [<a href="controller.pl?action=LoginScreen/user_login" target="_blank" title="[% 'Open a further kivitendo window or tab' | $T8 %]">[% 'New window/tab' | $T8 %]</a>]
     [<a href="JavaScript:top.print();" title="[% 'Hardcopy' | $T8 %]">[% 'Print' | $T8 %]</a>]
+[%- IF AUTH.assert('part_service_assembly_edit', 1) %]
+    [<input name="frame_header_parts_search" id="frame_header_parts_search" placeholder="[% 'Search parts' | $T8 %]" size="14">]
+[%- END %]
 [%- IF AUTH.assert('customer_vendor_edit|customer_vendor_edit_all', 1) %]
     [<input name="frame_header_contact_search" id="frame_header_contact_search" placeholder="[% 'Search contacts' | $T8 %]" size="14">]
 [%- END %]