[freeside-commits] freeside/FS/FS/cust_main Search.pm,1.5,1.6

Erik Levinson levinse at wavetail.420.am
Thu Nov 4 20:56:08 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv30168/FS/FS/cust_main

Modified Files:
	Search.pm 
Log Message:
add a multi-select for tags to advanced customer search, RT6376


Index: Search.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Search.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- Search.pm	4 Nov 2010 05:56:59 -0000	1.5
+++ Search.pm	5 Nov 2010 03:56:06 -0000	1.6
@@ -659,6 +659,21 @@
       "cust_main.custbatch = '$1'";
   }
 
+  if ( $params->{'tagnum'} ) {
+    my @tagnums = ref( $params->{'tagnum'} ) ? @{ $params->{'tagnum'} } : ( $params->{'tagnum'} );
+
+    @tagnums = grep /^(\d+)$/, @tagnums;
+
+    if ( @tagnums ) {
+	my $tags_where = "0 < (select count(1) from cust_tag where " 
+		. " cust_tag.custnum = cust_main.custnum and tagnum in ("
+		. join(',', @tagnums) . "))";
+
+	push @where, $tags_where;
+    }
+  }
+
+
   ##
   # setup queries, subs, etc. for the search
   ##



More information about the freeside-commits mailing list