add no_fuzzy_on_exact global, RT#24804
authorIvan Kohler <ivan@freeside.biz>
Fri, 6 Sep 2013 04:05:14 +0000 (21:05 -0700)
committerIvan Kohler <ivan@freeside.biz>
Fri, 6 Sep 2013 04:05:14 +0000 (21:05 -0700)
httemplate/pref/pref.html
httemplate/search/cust_main.cgi

index dc44db0..d2b8835 100644 (file)
@@ -108,6 +108,12 @@ Interface
     </TD>
   </TR>
 
     </TD>
   </TR>
 
+% if ( FS::Conf->new->exists('enable_fuzzy_on_exact') ) {
+
+  <INPUT TYPE="hidden" NAME="enable_fuzzy_on_exact" VALUE="<% $curuser->option('enable_fuzzy_on_exact') ? 1 : 0 %>">
+
+% } else {
+
  <TR>
     <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching <BR>even when an exact match is found: </TH>
     <TD ALIGN="left" COLSPAN=2>
  <TR>
     <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching <BR>even when an exact match is found: </TH>
     <TD ALIGN="left" COLSPAN=2>
@@ -115,6 +121,8 @@ Interface
     </TD>
   </TR>
 
     </TD>
   </TR>
 
+% }
+
   <TR>
     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
     <TD ALIGN="left" COLSPAN=2>
   <TR>
     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
     <TD ALIGN="left" COLSPAN=2>
index 2c09c69..69f04f5 100755 (executable)
@@ -470,7 +470,9 @@ if ( $cgi->param('browse')
     $orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )";
     push @cust_main, smart_search(
       'search'            => scalar($cgi->param('search_cust')),
     $orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )";
     push @cust_main, smart_search(
       'search'            => scalar($cgi->param('search_cust')),
-      'no_fuzzy_on_exact' => ! $curuser->option('enable_fuzzy_on_exact'),
+      'no_fuzzy_on_exact' => ! ( $curuser->option('enable_fuzzy_on_exact')
+                                 || $conf->exists('enable_fuzzy_on_exact')
+                               ),
     );
   }
 
     );
   }