disable quotations without fully-qualifying all other searches, RT#20688, RT#22232
authorIvan Kohler <ivan@freeside.biz>
Sun, 18 Jan 2015 22:23:26 +0000 (14:23 -0800)
committerIvan Kohler <ivan@freeside.biz>
Sun, 18 Jan 2015 22:23:26 +0000 (14:23 -0800)
FS/FS/Record.pm
httemplate/search/quotation.html

index 4546741..0810a7e 100644 (file)
@@ -45,6 +45,8 @@ our $nowarn_classload = 0;
 our $no_update_diff = 0;
 our $no_history = 0;
 
+our $qsearch_qualify_columns = 0;
+
 our $no_check_foreign = 1; #well, not inefficiently in perl by default anymore
 
 my $rsa_module;
@@ -754,7 +756,7 @@ sub get_real_fields {
 
       my $op = '=';
       my $column = $_;
-      my $table_column = "$table.$column";
+      my $table_column = $qsearch_qualify_columns ? "$table.$column" : $column;
       my $type = dbdef->table($table)->column($column)->type;
       my $value = $record->{$column};
       $value = $value->{'value'} if ref($value);
index 6badb13..55c60f0 100755 (executable)
@@ -73,6 +73,8 @@ my $curuser = $FS::CurrentUser::CurrentUser;
 die "access denied"
   unless $curuser->access_right('List quotations');
 
+local($FS::Record::qsearch_qualify_columns) = 1;
+
 my $join_prospect_main = 'LEFT JOIN prospect_main USING ( prospectnum )';
 my $join_cust_main = FS::UI::Web::join_cust_main('quotation');