Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4bc122b8

Von Werner Hahn vor 16 Tagen hinzugefügt

  • ID 4bc122b8ac1abe52aa37f0bebf56f7af799ba966
  • Vorgänger 800aaec1
  • Nachfolger 25bc91e2

Volltextsuche auch bei Verkaufsrechnungen und Deb. Buchungen

Unterschiede anzeigen:

SL/AR.pm
667 667
    }
668 668
  }
669 669

  
670
  $form->{fulltext} = trim($form->{fulltext});
671
  if ($form->{fulltext}) {
672
    my @fulltext_fields = qw(a.notes
673
                             a.intnotes
674
                             a.shipvia
675
                             a.transaction_description
676
                             a.quonumber
677
                             a.ordnumber
678
                             a.invnumber);
679
    $where .= ' AND (';
680
    $where .= join ' OR ', map {"$_ ILIKE ?"} @fulltext_fields;
681

  
682
    $where .= <<SQL;
683
      OR EXISTS (
684
        SELECT files.id FROM files LEFT JOIN file_full_texts ON (file_full_texts.file_id = files.id)
685
          WHERE files.object_id = a.id AND files.object_type = 'invoice'
686
            AND file_full_texts.full_text ILIKE ?)
687
SQL
688
    $where .= ')'; # end AND
689

  
690
    push(@values, like($form->{fulltext})) for 1 .. (scalar @fulltext_fields) + 1;
691
  }
692

  
670 693
  if ($form->{parts_partnumber}) {
671 694
    $where .= <<SQL;
672 695
      AND EXISTS (
bin/mozilla/ar.pl
1154 1154
    business_id parts_partnumber parts_description department_id
1155 1155
    show_marked_as_closed show_not_mailed shippingpoint shipvia taxzone_id
1156 1156
    payment_id shiptoname shiptodepartment_1 shiptodepartment_2 shiptostreet
1157
    shiptozipcode shiptocity shiptocountry
1157
    shiptozipcode shiptocity shiptocountry fulltext
1158 1158
  );
1159 1159
  push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables;
1160 1160

  
......
1331 1331
  if ($form->{shiptocountry}) {
1332 1332
    push @options, $locale->text('Country (Shipping)') . " : $form->{shiptocountry}";
1333 1333
  }
1334
  if ($form->{fulltext}) {
1335
    push @options, $locale->text('Full Text') . " : $form->{fulltext}";
1336
  }
1334 1337

  
1335 1338
  $form->{ALL_PRINTERS} = SL::DB::Manager::Printer->get_all_sorted;
1336 1339

  
templates/design40_webpages/ar/search.html
39 39
        <tr>
40 40
          <th class="caption" colspan="2">[% 'Miscellaneous' | $T8 %]</th>
41 41
        </tr>
42
        <tr>
43
          <th>[% 'Full Text' | $T8 %]</th>
44
          <td>[% L.input_tag('fulltext', '') %]</td>
45
        </tr>
42 46
        <tr>
43 47
          <th>[% 'Transaction description' | $T8 %]</th>
44 48
          <td>[% L.input_tag("transaction_description", "") %]</td>
templates/webpages/ar/search.html
59 59
      <th align="right">[% 'Part Number' | $T8 %]</th>
60 60
      <td>[% L.input_tag("parts_partnumber", "", style=style) %]</td>
61 61
     </tr>
62
     <tr>
63
      <th align="right">[% 'Full Text' | $T8 %]</th>
64
      <td>[% L.input_tag('fulltext', '', style=style) %]</td>
65
     </tr>
62 66
     <tr>
63 67
      <th align=right nowrap>[% 'Shipping Point' | $T8 %]</th>
64 68
      <td>[% L.input_tag("shippingpoint", "", style=style) %]</td>

Auch abrufbar als: Unified diff