[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Disabling wildcards for customer name search



It is sometimes necessary to disable automatic
wildcard searching especially when you have customer
names like:
mycustomer1
mycustomer11
mycustomer111

Currently, if you enter mycustomer1, you end up with
mycustomer11 and mycustomer111 in the list

Therefore, I would like to submit the following patch
which disables wildcard search when the user specifies
"mycustomer1" (i.e. quoted)

--- Form.pm.old 2008-02-22 15:20:19.000000000 -0500
+++ Form.pm     2008-02-22 15:33:40.000000000 -0500
@@ -2453,7 +2453,14 @@
 
     my ( $self, $str ) = @_;
 
-    "%$str%";
+    if ($str !~ /(%|_)/) {
+        if ($str =~ /(^").*("$)/) {
+             $str =~ s/(^"|"$)//g;
+            $str = "$str";
+        } else {
+            $str = "%$str%";
+        }
+    }
 }
 
 sub redo_rows {
 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs