summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2001-09-11 00:08:18 +0000
committerivan <ivan>2001-09-11 00:08:18 +0000
commitf5266a4d07d116efd732f433d0f4f3a47b143a7d (patch)
tree30b5bd95a9d3b3c588ab097f1877ae0d27e96741 /httemplate/search
parent85e59606c0b5eed9780534ffaf554aa32bcf9baf (diff)
faster (cached) fuzzy searches
prelim. job queues! fixed part_svc editing
Diffstat (limited to 'httemplate/search')
-rwxr-xr-xhttemplate/search/cust_main.cgi20
1 files changed, 9 insertions, 11 deletions
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 5defaf4af..9dcada7c2 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -1,5 +1,5 @@
<%
-#<!-- $Id: cust_main.cgi,v 1.4 2001-08-28 16:58:08 ivan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.5 2001-09-11 00:08:18 ivan Exp $ -->
use strict;
#use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby );
@@ -253,13 +253,12 @@ sub lastsearch {
} else {
- my(%last);
+ &FS::cust_main::check_and_rebuild_fuzzyfiles;
+ my $all_last = &FS::cust_main::all_last;
- my(@all_last)=map $_->getfield('last'), qsearch('cust_main',{});
- push @all_last, grep $_, map $_->getfield('ship_last'), qsearch('cust_main',{})
- if defined dbdef->table('cust_main')->column('ship_last');
+ my %last;
if ($last_type{'Fuzzy'}) {
- foreach ( amatch($last, [ qw(i) ], @all_last) ) {
+ foreach ( amatch($last, [ qw(i) ], @$all_last) ) {
$last{$_}++;
}
}
@@ -300,13 +299,12 @@ sub companysearch {
} else {
- my(%company);
- my(@all_company)=map $_->company, qsearch('cust_main',{});
- push @all_company, grep $_, map $_->getfield('ship_company'), qsearch('cust_main',{})
- if defined dbdef->table('cust_main')->column('ship_last');
+ &FS::cust_main::check_and_rebuild_fuzzyfiles;
+ my $all_company = &FS::cust_main::all_company;
+ my %company;
if ($company_type{'Fuzzy'}) {
- foreach ( amatch($company, [ qw(i) ], @all_company ) ) {
+ foreach ( amatch($company, [ qw(i) ], @$all_company ) ) {
$company{$_}++;
}
}