From 18f51a14e90cf1548326419120cdba1c33d99c63 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 14 Jun 2002 00:12:49 +0000 Subject: [PATCH] search by for address2 (unit) - commented out in default index.html --- httemplate/index.html | 1 + httemplate/search/cust_main.cgi | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/httemplate/index.html b/httemplate/index.html index c3e9ae45c..5b9b18a6f 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -31,6 +31,7 @@
Customer # or all customers by customer number
Last name or all customers by last name
Company or all customers by company
+
Phone #

Username or all accounts by username

Domain or all domains
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 1bd5fb60a..586f8d991 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -200,6 +200,8 @@ if ( $cgi->param('browse') if $cgi->param('last_on') && $cgi->param('last_text'); push @cust_main, @{&companysearch} if $cgi->param('company_on') && $cgi->param('company_text'); + push @cust_main, @{&address2search} + if $cgi->param('address2_on') && $cgi->param('address2_text'); push @cust_main, @{&phonesearch} if $cgi->param('phone_on') && $cgi->param('phone_text'); push @cust_main, @{&referralsearch} @@ -555,9 +557,10 @@ sub companysearch { $company_type{$_}++ }; - $cgi->param('company_text') =~ /^([\w \,\.\-\']*)$/ - or eidiot "Illegal company"; - my($company)=$1; + $cgi->param('company_text') =~ + /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ + or eidiot "Illegal company"; + my $company = $1; if ( $company_type{'Exact'} || $company_type{'Fuzzy'} ) { push @cust_main, qsearch( 'cust_main', @@ -609,6 +612,25 @@ sub companysearch { \@cust_main; } +sub address2search { + my @cust_main; + + $cgi->param('address2_text') =~ + /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ + or eidiot "Illegal address2"; + my $address2 = $1; + + push @cust_main, qsearch( 'cust_main', + { 'address2' => { 'op' => 'ILIKE', + 'value' => $address2 } } ); + push @cust_main, qsearch( 'cust_main', + { 'address2' => { 'op' => 'ILIKE', + 'value' => $address2 } } ) + if defined dbdef->table('cust_main')->column('ship_last'); + + \@cust_main; +} + sub phonesearch { my @cust_main; -- 2.11.0