oe.pl: Schnellsuche analog zu all:substr:multi::ilike
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 24 Mar 2016 13:14:22 +0000 (14:14 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 24 Mar 2016 13:22:43 +0000 (14:22 +0100)
SL/OE.pm
bin/mozilla/oe.pl
locale/de/all

index 4599443..1c812e2 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -50,6 +50,7 @@ use SL::DBUtils;
 use SL::HTML::Restrict;
 use SL::IC;
 use SL::TransNumber;
+use Text::ParseWords;
 
 use strict;
 
@@ -285,6 +286,18 @@ SQL
     push @values, conv_date($form->{expected_billing_date_to});
   }
 
+  if ($form->{all}) {
+    my @tokens = parse_line('\s+', 0, $form->{all});
+    # ordnumber quonumber customer.name vendor.name transaction_description
+    $query .= qq| AND (
+      o.ordnumber ILIKE ? OR
+      o.quonumber ILIKE ? OR
+      ct.name     ILIKE ? OR
+      o.transaction_description ILIKE ?
+    )| for @tokens;
+    push @values, ("%$_%")x4 for @tokens;
+  }
+
   my ($cvar_where, @cvar_values) = CVar->build_filter_query('module'         => 'CT',
                                                             'trans_id_field' => 'ct.id',
                                                             'filter'         => $form,
index 4c29292..ed13848 100644 (file)
@@ -984,6 +984,7 @@ sub orders {
   push @options, $locale->text('Customer Order Number')   . " : $form->{cusordnumber}"                    if $form->{cusordnumber};
   push @options, $locale->text('Notes')                   . " : $form->{notes}"                           if $form->{notes};
   push @options, $locale->text('Transaction description') . " : $form->{transaction_description}"         if $form->{transaction_description};
+  push @options, $locale->text('Quick Search')            . " : $form->{all}"                             if $form->{all};
   push @options, $locale->text('Shipping Point')          . " : $form->{shippingpoint}"                   if $form->{shippingpoint};
   if ( $form->{transdatefrom} or $form->{transdateto} ) {
     push @options, $locale->text('Order Date');
index de2c7f2..93374b3 100755 (executable)
@@ -2187,6 +2187,7 @@ $self->{texts} = {
   'Quarterly'                   => 'quartalsweise',
   'Query Type'                  => 'Art der Abfrage',
   'Queue'                       => 'Warteschlange',
+  'Quick Search'                => 'Schnellsuche',
   'Quick Searches that will be shown in the header in this client' => 'Schnellsuchen, die in der Kopfzeile in diesem Mandanten gezeigt werden sollen',
   'Quotation'                   => 'Angebot',
   'Quotation Date'              => 'Angebotsdatum',